當前位置: 首頁 >> web 技術 >> ASP 相關時間函數 >> 正文

ASP 相關時間函數

2015-02-24     分類:web 技術     閱讀次數:1402     評論(0)    
<%=formatdatetime(now(),0)%>
<%=formatdatetime(now(),1)%>
<%=formatdatetime(now(),2)%>
<%=formatdatetime(now(),3)%>
<%=formatdatetime(now(),4)%>

顯示的結果為:

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


轉載請註明出處為「本文轉載於『油拉林』原地址: http://blog.hiastro.com.tw/webtechs/asp-time-functions

評論

發表評論   

暱稱*

E-mail*(建議輸入,以便收到博主回復的提示郵件)

網站

驗證碼*