Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

VBScript DateSerial function


May 13, 2021 VBScript


Table of contents


VBScript DateSerial function

The VBScript DateSerial function returns the Variant of the Date sub-type for the specified year, month, and day.


VBScript DateSerial function Complete VBScript reference manual

The DateSerial function returns variant of the sub-type Date for the specified year, month, and day.

Grammar

DateSerial(year,month,day)

Parameters

parameter describe
year Required.Numbers, or numerical expressions between 100 to 9999.The value between 0 to 99 is considered to be 1900-1999.For all other Year parameters, use a complete 4-digit year.
month Required.Any numerical expression.
day Required.Any numerical expression.

Instance 1

<script type="text/vbscript">

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

</script>

The above example output results:

2/3/2010

Try it out . . .

Instance 2

Subtract 10 days:

<script type="text/vbscript">

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

</script>

The above example output results:

1/24/2010

Try it out . . .


VBScript DateSerial function Complete VBScript reference manual