/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

2/17/2019

Date, Time, and Now Functions Results
Date() 2/17/2019
Time() 8:46:44 PM
Now() 2/17/2019 8:46:44 PM
formatDateTime(Date,0) 2/17/2019
formatDateTime(Date,1) Sunday, February 17, 2019
formatDateTime(Date,2) 2/17/2019
formatDateTime(Time,0) 8:46:44 PM
formatDateTime(Time,2) 12/30/1899
formatDateTime(Time,3) 8:46:44 PM
formatDateTime(Now,0) 2/17/2019 8:46:44 PM
formatDateTime(Now,1) Sunday, February 17, 2019
formatDateTime(Now,2) 2/17/2019
formatDateTime(Now,3) 8:46:44 PM
formatDateTime(Now,4) 20:46