WeekdayFromDate function

Returns the day number of the week from the given date. Base day optionally specifies the day that is regarded as the first in the week and is Sunday by default.

Namespace

datetime

Input

date(date|string), [Base day(int|string)]

Output

day(int)

Example

If basedate contains the date 2008-08-18, then the two following functions are equivalent, and return the value 1

set-column result datetime:WeekdayFromDate('2008-08-18') set-column result datetime:WeekdayFromDate(basedate)

If basedate contains the date 2008-08-18, and baseday contains saturday, then the two following functions are equivalent, and return the value 2

set-column result datetime:WeekdayFromDate('2008-08-18', "saturday") set-column result datetime:WeekdayFromDate(basedate,baseday)

 

Created in 2020 by Google Inc.