/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

4/16/2024

Date, Time, and Now Functions Results
Date() 4/16/2024
Time() 12:57:19 PM
Now() 4/16/2024 12:57:19 PM
formatDateTime(Date,0) 4/16/2024
formatDateTime(Date,1) Tuesday, April 16, 2024
formatDateTime(Date,2) 4/16/2024
formatDateTime(Time,0) 12:57:19 PM
formatDateTime(Time,2) 12/30/1899
formatDateTime(Time,3) 12:57:19 PM
formatDateTime(Now,0) 4/16/2024 12:57:19 PM
formatDateTime(Now,1) Tuesday, April 16, 2024
formatDateTime(Now,2) 4/16/2024
formatDateTime(Now,3) 12:57:19 PM
formatDateTime(Now,4) 12:57