Display Month

There are a number of ways that you can display the month # or month name on your web pages. Here are two quick ways to do it with ASP and VBScript:

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

This script displays the current month number like this:  12

 

<% Response.Write (MonthName(3,true)) %>

This script displays the current month number like this:  Dec

 

If you want to display the full name of a month, you can use this code:

<%
DIM iMonth
iMonth = Month(now)

Response.Write MonthName(iMonth)
%>

Both of these scripts display the month name like this:  December

< Back to ASP Scripts