Resources
| Display Date and Time in Many Formats |
| Posted by : Amit Agarwal |
Total Hits : 30078 |
The following functions explains on how you can display a date ot time in many formats using FormatDateTime function. FormatDateTime takes two input paraemeters, a required date variable and an optional date format.
vbGeneralDate - displays a date as a short date and a time as a long time.
vbLongDate - displays a date in the long format
vbShortDate - displays a date in the short format
vbLongTime - displays a time using the long format
vbShortTime - displays a time using the 24-hour format
|
|
|
Get the Source Code.
Dim Currdate Currdate = Now()
Response.Write "vbGeneralDate - " & FormatDateTime(Currdate, vbGeneralDate) & "<BR>" Response.Write "vbLongDate - " & FormatDateTime(Currdate, vbLongDate) & "<BR>" Response.Write "vbShortDate - " & FormatDateTime(Currdate, vbShortDate) & "<BR>" Response.Write "vbLongTime - " & FormatDateTime(Currdate, vbLongTime) & "<BR>" Response.Write "vbShortTime - " & FormatDateTime(Currdate, vbShortTime) & "<BR>"
|
|
|
|
 |
|
 |