User Tools

Site Tools


syntax:functions:yearweek

YearWeek(date)

Category: Date and Time function


Description

This function returns a time period formatted as year-ISO week number ("yyyy-W##"), or an error if the argument is not a number date.


Arguments

ArgumentTypeDescription
dateDate or Number (date serial)A expression representing a date. See "Remarks" below for details.

Return value type: String


Remarks

The date argument can take any value or expression that evaluates to a date serial value, with or without a time portion. Examples include:

  • A date string: #2019-12-12
  • A date serial value: 43811 (the date serial for "2019-12-12")
  • A date value created using the Date function: date("2019-12-12","yyyy-MM-dd").


Examples

yearweek(#2025-02-25)  //Returns "2025-W09"
yearweek(44426)  //Returns "2021-W33" (44426 equivalent to August 18th, 2021)


See also

syntax/functions/yearweek.txt · Last modified: 2025/03/18 17:13 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki