当前位置: 代码迷 >> ASP >> 日期格式有关问题
  详细解决方案

日期格式有关问题

热度:187   发布时间:2012-03-02 14:40:29.0
日期格式问题
2007-1-1
转为2007年1月1日


------解决方案--------------------
ArrDate=split( "2007-1-1 ", "- ")
response.write ArrDate(0)& "年 "&ArrDate(1)& "月 "&ArrDate(2)& "日 "
------解决方案--------------------
str= "2007-1-1 "
response.write year(str)& "年 "&month(str)& "月 "&day(str)& "日 "

------解决方案--------------------
把2007-1-1减一天
dateadd( "d ", "2007-1-1 ", "-1 ")
去查函数用法
------解决方案--------------------
<%

SetLocale( "zh-cn ")

dim dt:dt=cDate( "2007-1-1 ")

Response.Write(FormatDateTime(dt, vbLongDate))
%>
  相关解决方案