VBScript Year Function



VBScript Year()

VBScript Year() function returns an integer which represents an year of the specified date

Syntax :

Year(date) 

VBScript Year() : Example

<!DOCTYPE html>
<html>
<body>
<script language="vbscript" type="text/vbscript">
 document.write(Year("2024-11-11"))
</script>
</body>
</html>

Output :

After running above script in IE we will get following output -

2014