/home/web-programming/asp/

ASP Date, Time, and Now Functions

The ASP Date(), Time(), and Now() functions are used to return the date or time in various formats.

ASP Coding for Date Function

<%

Response.Write Date()

%>


OR

<%

=Date()

%>


Result

10/2/2023

Date, Time, and Now Functions Results
Date() 10/2/2023
Time() 9:44:09 PM
Now() 10/2/2023 9:44:09 PM
formatDateTime(Date,0) 10/2/2023
formatDateTime(Date,1) Monday, October 2, 2023
formatDateTime(Date,2) 10/2/2023
formatDateTime(Time,0) 9:44:09 PM
formatDateTime(Time,2) 12/30/1899
formatDateTime(Time,3) 9:44:09 PM
formatDateTime(Now,0) 10/2/2023 9:44:09 PM
formatDateTime(Now,1) Monday, October 2, 2023
formatDateTime(Now,2) 10/2/2023
formatDateTime(Now,3) 9:44:09 PM
formatDateTime(Now,4) 21:44