Date Intrinsic Functions - Week Method

Return the week number

Member of Date Intrinsic Functions (PRIM_LIBI.IDateIntrinsics)

Parameters

NameTypeData TypeDescription
Result*Result (Optional)IntegerWeek number of the date
StartOfWeek*Input (Optional)EnumerationDay of the week to be used as the start of the week
Format*Input (Optional)EnumerationMethod used to evaluate the week number

Details

Week returns the week number associated with the date.
 
StartOfWeek defaults to Monday and Format defaults to ISO

Allowed Formats

Enum ValueDescription
FirstDayStart evaluating weeks based on January 1st
ISO Follows the ISO 8601 standard for the start of the year

Example

In this example, a date of 2011-01-01 which was a Saturday would return 52 as the ISO standard means it's part of the last week of the previous year.
#Result := #Today.Week
However, the same date would produce a result of 1 if measured using FirstDay
#Result := #Today.Week(Monday FirstDay)

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2