VBScript DateSerial Function

The DateSerial function returns a Variant of subtype Date for a specified year, month, and day."

Examples

Example 1

<%

response.write(DateSerial(2010,2,3))

%>

The output of the code above will be:

2/3/2010

Example 2

Subtract 10 days:

<%

response.write(DateSerial(2010,2,3-10))

%>

The output of the code above will be:

1/24/2010

❮ Complete VBScript Reference