VBScript DateValue Function
Complete VBScript Reference Manual
The DateValue function converts a string to a Date.
**Note:** If the year part of the date is omitted, the function uses the current year from the computer's system date.
**Note:** If the date parameter contains time information, it is not returned. If the date contains invalid time information, a run-time error occurs.
Syntax
DateValue(date)
| Parameters | Description |
|---|---|
| date | Required. A date between January 1, 100 and December 31, 9999, or any expression that represents a date, a time, or both. |
Example
Example
The example above produces the following output:
1/31/2010
1/31/2010
Try it »
Complete VBScript Reference Manual