Week numbers - only ISO8601 format?

So today (7/7/22) if use the following:


outputs (on the Mac, not tested on iOS):


In somewhere like the US, where the week starts on Sunday this is not the right week number which is 28.

But I figured one of those three formats would get me the right thing and they’re not.

What are you expecting?

Formatting uses the strftime standard library. 27 is the result I get in a quick test of different implementations.

Week numbers are zero-indexed, so Jan. 1 would be in week 0 - is that throwing you off?

Note the relevance of the week with the first Thursday in it for week referencing.

I guess I’m expecting it to match the US locale and rule since I’m in the US.

US rule has week 1 as the week with 1/1 (so this year, because 1/1 was on a Saturday, the first week of 2022 actually included 12/26). ISO8601 has the first week as the one with 1/4 in it. They might match (like next year where both 1/1 and 1/4 are in week 1)… They might not.

The Calendar application on the Mac and iOS (and Outlook) follows the system locale and has this week as week 28.



Obsidian “Periodic Notes” plugin, which uses moment.js, also has this as week 28 per their docs:


The strftime handling of week number is a bit odd if you’re in the US.

This went right over my head and just re-read. Are you saying that we need to add 1 to the week number thats returned by the %(U|V|W) expression?