RLWD Programming

ASP Date, Time, and Now Functions

Sponsored Ads

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/3/2012



Date, Time, and Now Functions Results
Date() 2/3/2012
Time() 9:52:38 PM
Now() 2/3/2012 9:52:38 PM
formatDateTime(Date,0) 2/3/2012
formatDateTime(Date,1) Friday, February 03, 2012
formatDateTime(Date,2) 2/3/2012
formatDateTime(Time,0) 9:52:38 PM
formatDateTime(Time,2) 12/30/1899
formatDateTime(Time,3) 9:52:38 PM
formatDateTime(Now,0) 2/3/2012 9:52:38 PM
formatDateTime(Now,1) Friday, February 03, 2012
formatDateTime(Now,2) 2/3/2012
formatDateTime(Now,3) 9:52:38 PM
formatDateTime(Now,4) 21:52