/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

1/27/2020

Date, Time, and Now Functions Results
Date() 1/27/2020
Time() 8:27:45 AM
Now() 1/27/2020 8:27:45 AM
formatDateTime(Date,0) 1/27/2020
formatDateTime(Date,1) Monday, January 27, 2020
formatDateTime(Date,2) 1/27/2020
formatDateTime(Time,0) 8:27:45 AM
formatDateTime(Time,2) 12/30/1899
formatDateTime(Time,3) 8:27:45 AM
formatDateTime(Now,0) 1/27/2020 8:27:45 AM
formatDateTime(Now,1) Monday, January 27, 2020
formatDateTime(Now,2) 1/27/2020
formatDateTime(Now,3) 8:27:45 AM
formatDateTime(Now,4) 08:27