FormatDateTime() function in ASP
This function uses the following format:
FormatDateTime(date, format)
There are two arguments the function accepts: date and format.
- Date: Any valid date expression such as Date() or Now()
- Format: Constant specifing how the date and/or time will be displayed
The format can either type the constant name or it's corresponding value (0-4).
- vbGeneralDate (0) mm/dd/yy or hh:mm:ss PM/AM format if Now()
- vbLongDate (1) weekday, month day, year
- vbShortDate (2) mm/dd/yy
- vbLongTime (3) hh:mm:ss PM/AM
- vbShortTime (4) hh:mm
Note : If used on the server side, the date/time returned will be whatever the server's date and time is, not your client's time from their system.
Published Thursday, June 03, 2004

