getWeekday

Summary

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

Usage

public int getWeekday()

Returns

The day of the week of the System.Date object according to local time.

Description

Returns the day of the week of the System.Date object according to local time.

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.getWeekday()); // 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.getWeekday();
Console.log(wd == Date.Weekday.THURS); // true

Share

HTML | BBCode | Direct Link