/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/18/2017

Date, Time, and Now Functions Results
Date() 10/18/2017
Time() 6:54:50 PM
Now() 10/18/2017 6:54:50 PM
formatDateTime(Date,0) 10/18/2017
formatDateTime(Date,1) Wednesday, October 18, 2017
formatDateTime(Date,2) 10/18/2017
formatDateTime(Time,0) 6:54:50 PM
formatDateTime(Time,2) 12/30/1899
formatDateTime(Time,3) 6:54:50 PM
formatDateTime(Now,0) 10/18/2017 6:54:50 PM
formatDateTime(Now,1) Wednesday, October 18, 2017
formatDateTime(Now,2) 10/18/2017
formatDateTime(Now,3) 6:54:50 PM
formatDateTime(Now,4) 18:54