Product Site

5.4.6.22. weekNumberDate

Returns the timestamp formatted as a string in extended ISO week number date format yyyy-Www-d with leading zeros as required.

See also methods fromWeekNumberDate (Class Method) and weekNumberYear, and weekDay.

Example 5.233. DateTime class — weekNumberDate method
say .DateTime~new(2018, 12, 31)~weekNumberDate    -- 2019-W01-1
say .DateTime~new(2019,  1,  1)~weekNumberDate    -- 2019-W01-2

say .DateTime~new(2020, 12, 31)~weekNumberDate    -- 2020-W53-4
say .DateTime~new(2021,  1,  1)~weekNumberDate    -- 2020-W53-5