This article lists some commonly used ASP time functions and how to get the server time. Friends who are interested can learn about it and just consolidate their knowledge. I hope this article will be helpful to you. 1. Commonly used ASP time functions
1. now() gets the current system date and time, ASP output format: <%=now()%>
2. Year(now()) gets the year, ASP output format: <%=Year(now())%>
3. Month(now()) gets the current month, ASP output format: <%=Month(now())%>
4. day(now()) gets the number of the day, ASP output format: <%=day(now())%>
5. hour(now()) gets the hour, ASP output format: <%=hour(now())%>
6. Minute(now()) gets the minutes, ASP output format: <%=Minute(now())%>
7. Second(now()) gets the number of seconds, ASP output format: <%=Second(now())%>
8. date() gets the current system date, ASP output format: <%=date()%>
9. time() gets the current system time, ASP output format: <%=time()%>
10. weekdayname(weekday(now)) gets the current system week, ASP output format: <%=weekdayname(weekday(now))%>
2. Time function output result, taking 2013-01-04 05:20:00 Friday as an example:
1. <%=now()%> The output result is: 2013-01-04 05:20:00
2. <%=Year(now())%> The output result is: 2013
3. <%=Month(now())%> The output result is: 01
4. <%=day(now())%> The output result is: 04
5. <%=hour(now())%> The output result is: 05
6. <%=Minute(now())%> The output result is: 20
7. <%=Second(now())%> The output result is: 00
8. <%=date()%> The output result is: 2013-01-04
9. <%=time()%> The output result is: 05:20:00
10. <%=weekdayname(weekday(now))%> The output result is: Friday