FUNCTION: FormatDateTime( )
FormatDateTime(Date, DateFormat)
The FormatDateTime function formats dates and times.
There is one mandatory
arguments.
Date
The Date argument is any valid date expression.
Code:
<% =FormatDateTime("6/26/1943") %>
<% =FormatDateTime("15:34") %>
Output:
6/26/43
3:34:00 PM
There is one optional
arguments.
DateFormat
The optional DateFormat argument must use the constant or value
from
the Date Format CONSTANTS.
CONSTANT | VALUE | DESCRIPTION |
VBGENERALDate | 0 | Display the date and time using system
settings |
VBLONGDate | 1 | Display the date in long date format
June 26, 1943 |
VBSHOrTDate | 2 | Display the date in short date format
6/26/43 |
VBLONGTime | 3 | Display the time in long time format
3:48:01 PM |
VBSHOrTTime | 4 | Display the time in short time format (24
hour clock)
15:48 |
Code:
<% =FormatDateTime("6/26/1943", 1) %>
<% =FormatDateTime("3:34:00 PM", 4) %>