【备忘】ASP时间函数相关

【备忘】ASP时间函数相关

<%=formatdatetime(now(),0)%><br>
<%=formatdatetime(now(),1)%><br>
<%=formatdatetime(now(),2)%><br>
<%=formatdatetime(now(),3)%><br>
<%=formatdatetime(now(),4)%><br>
显示的结果为:
2011/4/16 12:01:46
2011年4月16日
2011/4/16
12:01:46
12:01

Function Formatdate(thedate)
dYear = Year(thedate)
dMonth = Month(thedate)
dDay = Day(thedate)
dHour = Hour(thedate)
dMinute = Minute(thedate)
dSecond = Second(thedate)
Formatdate = dYear&Right( "0 "&dMonth, "2")&Right( "0 "&dDay, "2 ")
End Function

原文链接:https://www.wdssmq.com/post/ASPShiJianHanShuXiangGuan.html

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。