getMonth

Summary

Returns the month of the System.Date object according to local time.

Usage

public int getMonth()

Returns

The month value of the System.Date object according to local time.

Description

Returns the month of the System.Date object according to local time.

In order to maintain compatibility with ECMAScript, this method does not return a System.Date.Month enumeration value. A cast is available from the return value of getMonth() to the System.Date.Month enumeration.

Examples

Basic Usage
1
2
3
4
import System;
 
Date d = new Date(2011, Date.Month.JAN);
Console.log(d.getMonth()); // 0
Casting to System.Date.Month
1
2
3
4
5
import System;
 
Date d = new Date(2011, Date.Month.FEB);
Date.Month m = (Date.Month) d.getMonth();
Console.log(m == Date.Month.FEB); // true

Share

HTML | BBCode | Direct Link