getUTCWeekday

Summary

Returns the day of the week of the System.Date object according to Coordinated Universal Time (UTC). In order to maintain API consistency and compatibility withECMAScript, this method does not return a System.Date.Weekday enumeration value just as with `System.

Usage

public int getUTCWeekday()

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 API consistency and compatibility with ECMAScript, this method does not return a System.Date.Weekday enumeration value just as with System.Date.getDay. A cast is available from the return value of getWeekday() 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.getUTCWeekday()); // 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.getUTCWeekday();
Console.log(wd == Date.Weekday.THURS); // true

Share

HTML | BBCode | Direct Link