webCOMAND

WEEKDAY()

Return the week day number represented by a date or timestamp, in the range of 0 (Monday) to 6 (Sunday).

Prototype

integer WEEKDAY(mixed $timestamp)

Parameters

  • timestamp - A date ("YYYY-MM-DD") or timestamp ("YYYY-MM-DD HH:MM:SS").

Return

The week day number represented by a date or timestamp, or NULL if there is an error, such as an invalid timestamp.

Example

SELECT OID, WEEKDAY(META(LastModified)) AS WeekModified FROM User

See Also

WEEK(), DAYOFMONTH(), DAYOFYEAR()