Literal strings in the date format must be quoted with an apostrophe (', Unicode U+0027, aka “single vertical quote”), not with a left single quotation mark (’, Unicode U+2018, aka “typographical quotation mark”). With
YYYY-'Wk'w
you'll get the expected result, for example "2024-Wk37".
Here is the corresponding part from the Unicode #35 Standards: Date Format Patterns (emphasis added):
- Literal text, which is output as-is when formatting, and must closely match when parsing. Literal text can include:
- Any characters other than A..Z and a..z, including spaces and punctuation.
- Any text between single vertical quotes ('xxxx'), which may include A..Z and a..z as literal text.
- Two adjacent single vertical quotes (''), which represent a literal single quote, either inside or outside quoted text.