一、常用的ASP時(shí)間函數(shù)
1、now() 獲取當(dāng)前系統(tǒng)日期和時(shí)間,ASP輸出格式:<%=now()%>
2、Year(now()) 獲取年份, ASP輸出格式:<%=Year(now())%>
3、Month(now()) 獲取當(dāng)前月份,ASP輸出格式:<%=Month(now())%>
4、day(now()) 獲取當(dāng)天數(shù),ASP輸出格式:<%=day(now())%>
5、hour(now())獲取小時(shí)數(shù),ASP輸出格式:<%=hour(now())%>
6、Minute(now()) 獲取分鐘數(shù),ASP輸出格式:<%=Minute(now())%>
7、Second(now()) 獲取秒鐘數(shù),ASP輸出格式:<%=Second(now())%>
8、date() 獲取當(dāng)前系統(tǒng)日期,ASP輸出格式:<%=date()%>
9、time() 獲取當(dāng)前系統(tǒng)時(shí)間,ASP輸出格式:<%=time()%>
10、weekdayname(weekday(now))獲取當(dāng)前系統(tǒng)星期,ASP輸出格式:<%=weekdayname(weekday(now))%>
二、時(shí)間函數(shù)輸出結(jié)果,以 “2013-01-25 05:20:00 星期五”為例:
1、<%=now()%> 輸出結(jié)果為:2013-01-25 05:20:00
2、<%=Year(now())%> 輸出結(jié)果為:2013
3、<%=Month(now())%> 輸出結(jié)果為:01
4、<%=day(now())%> 輸出結(jié)果為:25
5、<%=hour(now())%> 輸出結(jié)果為:05
6、<%=Minute(now())%> 輸出結(jié)果為:20
7、<%=Second(now())%> 輸出結(jié)果為:00
8、<%=date()%> 輸出結(jié)果為:2013-01-25
9、<%=time()%> 輸出結(jié)果為:05:20:00
10、<%=weekdayname(weekday(now))%> 輸出結(jié)果為:星期五
建站咨詢(xún)熱線(xiàn)
029-33273980