Display Year

There are a number of ways that you can display the current year on your web pages.  Here is a very simple way to do it with ASP and VBScript:

<% Response.Write Year(now) %>
OR
<% Response.Write DatePart("yyyy", Date()) %>

This script displays the current four digit year like this:  2023

 

<% Response.Write DatePart("yy", Date()) %>

This script displays the current year like this:  23

< Back to ASP Scripts