Search w3schools.com:

SHARE THIS PAGE

VBScript Year Function


VBScript Reference Complete VBScript Reference

The Year function returns a number that represents the year.

Syntax

Year(date)

Parameter Description
date Required. Any expression that can represent a date

Example

Example

<script type="text/vbscript">

document.write(Year("2010-02-16"))

</script>

The output of the code above will be:

2010

Try it yourself »


VBScript Reference Complete VBScript Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]