Weeknum - wrong number

Trying to use weeknum math function

Trying to get weeknumber for date 24-09-2021

Glide says it is week 39. Google sheets says it is week 38 (which is correct)

Is this a bug or are weeknumbers different around the world. I don’t get it

1 Like

Both GSheets and Glide give me 39.

Screen Shot 2021-09-24 at 8.27.03 PM

Screen Shot 2021-09-24 at 8.27.33 PM

Just read the following in the GDoc reference:

Behind the scenes, there are two week numbering "systems" used for this function:
System 1 - The first week of the year is considered to be the week 
containing January 1, which is numbered week 1.
System 2 - The first week of the year is considered to be the week 
containing the first Thursday of the year, which is numbered as week 1. 
System 2 is the approach specified in ISO 8601, also known as the 
European system for numbering weeks.

Not sure if that makes any difference in your case.

1 Like

@Darren_Murphy thanks. Which week number do you have in Singapore? Is this truly week 39?

In Denmark it is week 38

@Darren_Murphy ah. I’m in system 2. ISO week numbering.

I’m not aware glide can do this week numbering - are you?

Maybe due to difference between time zones?

Well, system 2 also gives me 39…

Screen Shot 2021-09-24 at 8.33.34 PM

Looks like Glide may not support specifying which system to be used, at least not with the same syntax…

Screen Shot 2021-09-24 at 8.34.50 PM

Given that System 2 is ISO standard, I would hope (and expect) that to be the default. But, who knows? :man_shrugging:

The week number in Europe is 38 - and not 39😕

1 Like

Yes, you’re right.
I can only assume that Glide starts counting from Jan 1 (System 1).
The thing I don’t get is why the GSheet weeknum() function gives me 39 for both system 1 and system 2.
But I’m not going to lose any sleep over it :smiley:

1 Like

The function to use in google sheets is isoweeknum

https://support.google.com/docs/answer/7368793?hl=en

@mark is this function actually available in glide? So you can get the iso week number. This is what I need when living in Europe

2 Likes

This site is also a great reference for time-related things:
https://www.timeanddate.com/date/weeknumber.html

1 Like

I’ll look into it.

3 Likes

Glide’s implementation is correct:

image

We don’t have isoweeknum yet, sorry.

1 Like

Well, then the implementation isn’t really useful for me in Europe. This is a pity.
I might have to rely on google sheets