ASP/VBScript FormatDateTime() Returns an expression formatted as a date or time.
ShotDev Focus:
- Using Asp and FormatDateTime() function.
Syntax
<% FormatDateTime(Date[, NamedFormat]) %>
DateFormat
0 System Settings
1 Format (Ex : Saturday, June 26, 1943)
2 Format (Ex : 09/09/2008)
3 Format (Ex : 13:34:00)
4 Format (Ex : 13:34)
Example
asp_formatdatetime.asp
<% Option Explicit %> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <% Response.write FormatDateTime("09/01/2010",0)&"<br>" Response.write FormatDateTime("13:34:00",3)&"<br>" Response.write FormatDateTime("13:34:00",4)&"<br>" %> </body> </html>
Create a asp file and save to path root-path/myasp/
Run
http://localhost/myasp/asp_formatdatetime.asp
Screenshot