Automation Engine Script Guide > Ordered by Function > Date and Time > WEEK_NR

WEEK_NR

Script Function: Returns the calendar week of a date

Syntax

WEEK_NR(Date)

Syntax

Description/Format

Date

Indication of a date in the format "YYMMDD" or "YYYYMMDD".

Format: script literal or script variable

It is also possible to specify a different date format. Do so by entering the required date format, then enter a separator (: or ;) and afterwards the date. Indicating a date format is optional.


Return code

Calendar week (3-figure)

Comments

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.

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:

Script element Description

WEEKDAY_NR

Returns the day of a week of a given date as a number

WEEKDAY_XX

Returns the day of the week of a given date as an abbreviation

Script Elements - Date and Time

Date, Time and Period Formats

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by Function