dayofweek()dayofweek()

返回自上个星期日以来的整数天数,用作 timespanReturns the integer number of days since the preceding Sunday, as a timespan.

dayofweek(datetime(2015-12-14)) == 1d  // Monday

语法Syntax

dayofweek(a_date)dayofweek(a_date)

参数Arguments

  • a_datedatetimea_date: A datetime.

返回Returns

timespan从上个星期日的午夜开始,向下舍入为整数天数。The timespan since midnight at the beginning of the preceding Sunday, rounded down to an integer number of days.

示例Examples

dayofweek(datetime(1947-11-30 10:00:05))  // time(0.00:00:00), indicating Sunday
dayofweek(datetime(1970-05-11))           // time(1.00:00:00), indicating Monday