WEEK_NR

Script Function: Returns the calendar week of a date

Syntax

WEEK_NR ([Date Format:]Date)

Syntax

Description/Format

Date

Date in YYMMDD or YYYYMMDD format

Format: script literal or script variable

(Optional) You can specify a different date format: enter the desired date format, a separator (: or ;) and the date.


Return code

Calendar week (3-figure)

Optionally, you may specify a particular Date Format. The default Date Formats to be used are "YYMMDD" or "YYYYMMDD". A colon or semicolon may be used as a separator between Date Format and Date.

Warning! Calendar week calculation depends on the definitions made for the first calendar week of the year. The particular week that should be regarded as the starting week may be determined by the administrator in the variable UC_CLIENT_SETTINGS with the keys "FIRST_WEEK_METHOD" and "FIRST_DAY_OF_WEEK".

Example

The function returns the calendar week "052" of this day.

:SET &CW# = WEEK_NR("991231")

See also:

seealso

Script Date and Time Functions

Date, Time and Period Formats in Scripts