getUTCMonth

Summary

Returns the month of the System.Date object according to Coordinated Universal Time (UTC).

Usage

public int getUTCMonth()

Returns

The month value of the System.Date object according to Coordinated Universal Time (UTC).

Description

Returns the month of the System.Date object according to Coordinated Universal Time (UTC).

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 getUTCMonth() 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.getUTCMonth()); // 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.getUTCMonth();
Console.log(m == Date.Month.FEB); // true

Share

HTML | BBCode | Direct Link