getUTCDay

Summary

Returns the day of the week 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.Weekday enumeration value. A cast isavailable from the return value of getUTCDay() to the`System.

Usage

public int getUTCDay()

Returns

The day of the week of the System.Date object according to Coordinated Universal Time (UTC).

Description

Returns the day of the week 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.Weekday enumeration value. A cast is available from the return value of getUTCDay() to the System.Date.Weekday enumeration.

Examples

Basic Usage
1
2
3
4
import System;
 
Date d = new Date(2011, Date.Month.FEB, 10);
Console.log(d.getUTCDay()); // 4
Casting to System.Date.Weekday
1
2
3
4
5
import System;
 
Date d = new Date(2011, Date.Month.FEB, 10);
Date.Weekday wd = (Date.Weekday) d.getUTCDay();
Console.log(wd == Date.Weekday.THURS); // true

Share

HTML | BBCode | Direct Link