Month Function

Tips >>ASP Functions

WANTS TO MAKE SOFTWARE WITHOUT KNOWLEDGE OF ASP? CLICK HERE

The Month() function is used to determine the month from a date variable or formatted string. The Month function returns a number between 1 and 12 that represents the month of the year. If you've got a date and want to display the real world name of that month to display, the month name function is what you want. This function does NOT take in a full date - it takes in the month's ID number. So January is 1, February is 2, and so on. You can easily get the month number from a date using the Month function. The date argument is any expression that can represent a date. If date contains Null, Null is returned.

The Syntax of the Month function is :-

Month(date)

Example#1 :-

Code :-
document.write(Date & "<br />")
document.write(Month(Date))
Output :-
1/15/2006
1

Example 2 :-

Code :-
<%
=Month("March 12, 2006")
%>
Output :-
3

Example#3 :-

Code :-
<%
=Month("June 26, 206")
%>
Output :-
6


Example#4 :-

Code :-
<%
MyDate = Month("April 19, 2006")
%>
Output :-
4

Example#5 :-

Code :-
<%
MyDate = Month("May17,2006")
%>
Output :-
5


 
E-mail : sales@virtualsplat.com
Phone : +91-9892413501

+91-9967648641

+91-9967648641