Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

VBScript DateValue Function

VBScript DateValue Function


VBScript reference manual 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 »


VBScript reference manual Complete VBScript Reference Manual