Display Long and Short Dates

There are lots of ways to display dates on your web pages. Here are two quick ways to do it with ASP and VBScript.

<p><% Response.Write FormatDateTime(Date, vbLongDate) %></p>

This script displays the date like this:  Sunday, April 11th, 2021

 

You can also use the vbShortDate method like this:

<p><% Response.Write FormatDateTime(Date, vbShortDate) %></p>

This script displays the date like this:  04/11/2021

< Back to ASP Scripts