Subject | RE: [firebird-support] Extract week of the year (within year) |
---|---|
Author | Mark Rotteveel |
Post date | 2015-03-24T08:50:05Z |
On Tue, 24 Mar 2015 09:23:54 +0100, "Svein Erling Tysvær
svein.erling.tysvaer@... [firebird-support]"
<firebird-support@yahoogroups.com> wrote:
2015 according to the ISO definition if **Monday is the first day of the
week** in your locale, and it is week 53, 2014 if **Sunday is the first day
of the week** in your locale. Last week numbers of the year can range
between 51 and 53 iirc.
The first week of a year is that week of which the majority of the days
(four or more) fall in the new year. For locales using Monday as the first
day of the week (most of Europe) that is when the Thursday is in the new
year. For locales using Sunday as the first day of the week (eg US) that is
when the Wednesday is in the new year.
Mark
svein.erling.tysvaer@... [firebird-support]"
<firebird-support@yahoogroups.com> wrote:
> Actually, Karol, “week within year” is not the week, Karol. 1 Januaryconsider 1
> could be week 53 and 31 December could be week 1. If you want to
> January always as part of week 1 (even if that day could be the only dayof
> week 1), I’d suggest you try something like:If we are talking about Thursday January 1, 2015, then that is week 1,
2015 according to the ISO definition if **Monday is the first day of the
week** in your locale, and it is week 53, 2014 if **Sunday is the first day
of the week** in your locale. Last week numbers of the year can range
between 51 and 53 iirc.
The first week of a year is that week of which the majority of the days
(four or more) fall in the new year. For locales using Monday as the first
day of the week (most of Europe) that is when the Thursday is in the new
year. For locales using Sunday as the first day of the week (eg US) that is
when the Wednesday is in the new year.
Mark