VBScript YearFunction


VBScript 参考手册Complete VBScript Reference

The Year function returns a number that represents the year.

Syntax

Year(date)

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

Examples

Examples

<script type="text/vbscript">

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

</script>

Output of the above example:

2010

Try it yourself »


VBScript 参考手册Complete VBScript Reference Other Extensions