# Thread: Week of the year?

1. ## Week of the year?

Hi there!

How ist SILK calculating the week of a year?

I found in the german wikpedia this rules:

(translated)
The first week of a year is:
<ul type="square"> [*]the week with January, 1st (USA, Excel) [*]the week with at least 4 days of the new year (DIN 1355 / ISO 8601) [*]the first complete week in the year (rarely used) [/list]

I think, that SILK is using the last way to calculate the week. In our calendar, that uses ISO 8601, today we have week 49. SILK calculates week 48...

I use this statement to get the week of the year:

FormatDateTime (GetDateTime(), "ww")

2. ## Re: Week of the year?

Hi Peter,

Quite an interesting post dude.

According to this, there are atleast 6 possibilities - http://en.wikipedia.org/wiki/Week#Week_number

I guess you are right, ST is using the rare one where first week of year contains 7 January.

2lz

3. ## Re: Week of the year?

Well, this is "suboptimal"... *hmpft*

I cannot understand why Borland is using that strange calculation, because it makes some scenarios untestable for me...

Okay, I can write my own week-of-the-year-function, but why inventing the wheel again?

Do you have an idea to manipulate the formatdatetime(), that it is using the ISO 8601?

Greetings,

Peter

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.