|Powered by QM on a Rpi server|
KnowledgeBase 00053: ISO Week Number Conversions
This article was originally published as a Tip of the Week.
The International Organisation for Standardisation (ISO) defines the concept of week numbers as widely used in business and often printed in diaries. QM provides date conversion code elements to work with ISO week numbers.
ISO 8601 defines the rules such that week 1 is the week that has the first Thursday of the year in it. The ISO week begins on Monday and hence, based on this definition, it can be seen that a calendar date in the last few days of a year may, when viewed as an ISO 8601 date, lie in the first week of the next ISO year. Conversely, the first few days of the calendar year may be in the last week of the previous ISO year. Also, an ISO year may have either 52 or 53 weeks.
Date Conversion Code Elements
The WI element of the D (date) or E (epoch) output conversion codes returns the ISO week number in which the date lies. The YI element returns the ISO year number.
These elements are not supported in input conversions as they reference an entire week and not a specific date.