ASP/VBScript DateValue() Returns a Variant of subtype Date.
ShotDev Focus:
- Using Asp and DateValue() function.
Syntax
DateValue(date)
The date argument is normally a string expression representing a date from January 1, 100 through December 31, 9999. However, date can also be any expression that can represent a date, a time, or both a date and time, in that range.
Example
asp_datevalue.asp
<% Option Explicit %> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <% Response.write DateValue("01-Sep-2010")&"<br>" Response.write DateValue("Sep-01-2010")&"<br>" Response.write DateValue("Sep 01 2010")&"<br>" Response.write DateValue("09-01-2010")&"<br>" Response.write DateValue("09/01/2010")&"<br>" %> </body> </html>
Create a asp file and save to path root-path/myasp/
Run
http://localhost/myasp/asp_datevalue.asp
Screenshot