日期:2014-05-17  浏览次数:20802 次

ASP中日期转换8位字符
在ASP中我现在想把当前日期date()返回的值转换为8为字符,语句应该怎么写?
如cstr(date())返回的是 "2007-6-25 ",怎么让他返回 "20070625 "?

------解决方案--------------------
<%
'格式化日期
Function Formatdate(thedate)
dYear = Year(thedate)
dMonth = Month(thedate)
dDay = Day(thedate)
Formatdate = dYear&Right( "0 "&dMonth, "2 ")&Right( "0 "&dDay, "2 ")
End Function
%>