Incorrect week number when calculating in Europe/Amsterdam timezone (using formula field)

Are you using our SaaS platform (Baserow.io) or self-hosting Baserow?

Self-hosted

What are the exact steps to reproduce this issue?

When using a formula field in Baserow, with the following formula: datetime_format_tz(todate(field(‘Date entry__b4d6bedf-3d9a-497d-b62f-65a902f5a55d’), “YYYY-MM-DD”), “WW”, ‘Europe/Amsterdam’)

and the date is “2025-01-06”, it still gives 01 as week number, while it should be 02, right?

According to ISO 8601 standards week 01 of a year is defined as:

  • The week that contains the first Thursday of the year, OR
  • The week containing January 4th

Since January 1st, 2025 is a Wednesday and January 2nd is the first Thursday of the year, the week containing January 6th is actually correctly labeled as week 01.

Week 02 of 2025 would start on January 13th according to ISO standards.

1 Like

Hi @cwinhall ,

Thank you for your response!

Looking further into this topic ourselves on our end, we discovered that we should have used the formula like follows:

datetime_format_tz(todate(field(‘Date entry__b4d6bedf-3d9a-497d-b62f-65a902f5a55d’), “YYYY-MM-DD”), “IW”, ‘Europe/Amsterdam’)

So instead of using WW, we use IW now, which in combination with the datetime_format_tz formula and the target timezone.

And now it gives the expected weeknumbers.

Thanks for your response earlier.
Kind regards,
Stijn De Vos