跳到主要内容

Date.StartOfWeek

返回该周的开始时间。

Syntax

Date.StartOfWeek(
dateTime as any,
optional firstDayOfWeek as Day.Type
) as any

Remarks

返回包含 dateTime 的周开始值。 dateTime 必须是 datedatetimedatetimezone值。

Examples

Example #1

查找 2011 年 10 月 11 日星期二所在周的开始时间。

Date.StartOfWeek(#datetime(2011, 10, 11, 8, 10, 32))

Result:

// Sunday, October 9th, 2011
#datetime(2011, 10, 9, 0, 0, 0)

Example #2

查找 2011 年 10 月 11 日星期二所在周的开始时间(使用星期一作为该周开始)。

Date.StartOfWeek(#datetime(2011, 10, 11, 8, 10, 32), Day.Monday)

Result:

// Monday, October 10th, 2011
#datetime(2011, 10, 10, 0, 0, 0)

Category

Date