asp格式化日期字符串输出
这个函数怎么写,要求如下输入年,月,日返回日期字符串,字符串格式如下:比如3个参数为输入2009,5,13返回字符串为Wed13-May-2009这个怎么写啊?...
这个函数怎么写,要求如下
输入年,月,日返回日期字符串,字符串格式如下:
比如3个参数为输入2009,5,13
返回字符串为 Wed 13-May-2009
这个怎么写啊? 展开
输入年,月,日返回日期字符串,字符串格式如下:
比如3个参数为输入2009,5,13
返回字符串为 Wed 13-May-2009
这个怎么写啊? 展开
1个回答
展开全部
<%
'自定义函数
Function GMTtime(a,b,c)
Dim xx2wVar,xx2wToWeek, xx2wToMonth
xx2wVar = a & "-" & b & "-" & c
If Not IsDate( xx2wVar ) Then
xx2wVar = Now
Else
xx2wVar = CDate( xx2wVar )
End If
xx2wToWeek = Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")
xx2wToMonth = Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
GMTtime = xx2wToWeek( Weekday( xx2wVar ) - 1 ) &" "&right( xx2wAs & Day( xx2wVar ), 2 ) &"-"&xx2wToMonth( Month( xx2wVar ) - 1 ) &"-"&Year( xx2wVar )
End Function
'使用方法
response.write GMTtime(2009,5,13)
%>
'自定义函数
Function GMTtime(a,b,c)
Dim xx2wVar,xx2wToWeek, xx2wToMonth
xx2wVar = a & "-" & b & "-" & c
If Not IsDate( xx2wVar ) Then
xx2wVar = Now
Else
xx2wVar = CDate( xx2wVar )
End If
xx2wToWeek = Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat")
xx2wToMonth = Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
GMTtime = xx2wToWeek( Weekday( xx2wVar ) - 1 ) &" "&right( xx2wAs & Day( xx2wVar ), 2 ) &"-"&xx2wToMonth( Month( xx2wVar ) - 1 ) &"-"&Year( xx2wVar )
End Function
'使用方法
response.write GMTtime(2009,5,13)
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询