Visit Mozilla.org

Core JavaScript 1.5 Reference:Global Objects:Date:getUTCDay

From MDC


Contents

[edit] Summary

Returns the day of the week in the specified date according to universal time.

Method of Date
Implemented in: JavaScript 1.3
ECMA Version: ECMA-262

[edit] Syntax

getUTCDay()

[edit] Parameters

None.

[edit] Description

The value returned by getUTCDay is an integer corresponding to the day of the week: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on.

[edit] Examples

[edit] Example: Using getUTCDay

The following example assigns the weekday portion of the current date to the variable weekday.

var weekday;
Today = new Date()
weekday = Today.getUTCDay()

[edit] See Also

getDay, getUTCDate, setUTCDate