The week1st( function computes the first day of a week (Sunday).


This function has one parameter:

date – is a number representing the date.


This function calculates the first day of the week. For example, in the United States if the date passed to the function is July 12, 1995 (a Wednesday), it will return the date July 9, 1995 (a Sunday). The date is returned as a number.

datepattern(week1st(date("7/12/95")),"Month ddnth, YYYY") ☞ July 9th, 1995

As stated above the first day of the week is usually Sunday in the United States, but it can be different in other parts of the world, and it can be changed in the System Preferences Language & Region panel.

The week1st( function will honor this preference setting, so if the first day of the week is set to Monday, Saturday, or some other day, that is the day that will be returned by this function.

See Also


10.0UpdatedCarried over from Panorama 6.0, but now allows the first day of the week to be something other than Sunday if so specified in the system preferences.