Returns the day of the week as a number, where Sunday is the first day of the week and returns 1.
Function
result = weekday(input)
Arguments
Argument | Data Type |
input | date (datetime will be implicitly cast to date) |
---|---|
result | integer |
Comments
This function operates in the local time-zone if a datetime input is provided. See Dates, Times and Time Zones.
Examples
result = weekday(#2019-04-21#) /* result = 1 (Sunday) */
result = weekday(#2019-04-27#) /* result = 7 (Saturday) */
result = weekday(getdate())