/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

12/17/2018

Date, Time, and Now Functions Results
Date() 12/17/2018
Time() 12:04:53 AM
Now() 12/17/2018 12:04:53 AM
formatDateTime(Date,0) 12/17/2018
formatDateTime(Date,1) Monday, December 17, 2018
formatDateTime(Date,2) 12/17/2018
formatDateTime(Time,0) 12:04:53 AM
formatDateTime(Time,2) 12/30/1899
formatDateTime(Time,3) 12:04:53 AM
formatDateTime(Now,0) 12/17/2018 12:04:53 AM
formatDateTime(Now,1) Monday, December 17, 2018
formatDateTime(Now,2) 12/17/2018
formatDateTime(Now,3) 12:04:53 AM
formatDateTime(Now,4) 00:04