Date Intrinsic Functions - Week Method

Return the week number

Member of Date Intrinsic Functions (PRIM_LIBI.IDateIntrinsics)

Parameters

Name

Type

Data Type

Description

Result

*Result (Optional)

Integer

Week number of the date

StartOfWeek

*Input (Optional)

Enumeration

Day of the week to be used as the start of the week

Format

*Input (Optional)

Enumeration

Method 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 Value

Description

FirstDay

Start 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

  • No labels