The dayofweek( function computes the day of the week, with Sunday being 0, Monday 1, etc.


This function has one parameter:

date – is a number representing the date.


This function computes the day of the week as a number from 0 to 6, as shown in the table below.

Value Day Of Week
0 Sunday
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday

Note: The value returned by this function is not affected by the System Preference Languages & Regions panel. It will always return 0 for Sunday, no matter what day is specified in the preferences as the first day of the week. If you want to know what the preferred first day of the week is, use the firstdayofweek( function.

See Also


10.0No ChangeCarried over from Panorama 6.0