FormatDateTime 长日期问题

hnsongbiao 2008-07-29 01:37:41
FormatDateTime(Date, 1) 返回的是 2008年7月29日
FormatDateTime(Date, 2) 返回的是 2008-7-29


现在要返回2008-07-29

应该怎么写?
...全文
78 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
jhwcd 2008-07-31
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 jacklinchen 的回复:]
function totwo(str)
'''转换为2位
totwo=str
if len(totwo)=1 then totwo="0"&cstr(totwo)
end function

Response.Write year(date)&"-"&totwo(month(date))&"-"&totwo(day(date))
[/Quote]
cimzzxiang 2008-07-31
  • 打赏
  • 举报
回复
自己建个函数,做个判断啦。。
jacklinchen 2008-07-31
  • 打赏
  • 举报
回复
function totwo(str)
'''转换为2位
totwo=str
if len(totwo)=1 then totwo="0"&cstr(totwo)
end function

Response.Write year(date)&"-"&totwo(month(date))&"-"&totwo(day(date))
wtogether 2008-07-31
  • 打赏
  • 举报
回复
http://blog.csdn.net/wtogether/archive/2008/05/22/2469027.aspx

Response.Write FormatTime(Now(), "Y-m-d")
Shellbkboy 2008-07-29
  • 打赏
  • 举报
回复
FormatDateTime(Date, 0)
yrwx001 2008-07-29
  • 打赏
  • 举报
回复
你應該到 Asp,or asp.net 版中去問吧

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧