PowerBASIC Forums
  Cafe PowerBASIC
  Allow me to repeat my question?

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   Allow me to repeat my question?
Egbert Zijlema
Member
posted January 07, 2006 08:45 AM     Click Here to See the Profile for Egbert Zijlema     Edit/Delete Message   Reply w/Quote
Recently in the Windows-forum we had a discussion on week numbers: http://www.powerbasic.com/support/forums/Forum4/HTML/012994.html
A question of mine was: is it true that in Belgium, France, Spain and the UK the first week of the year (week number 1) is the week that contains January 1?
This is what my Windows (XP Home Edition, service pack 1) returns. It would not be in line with ISO 8601 though.

Nobody replied to that question, maybe simply because PB-programmers from the above mentioned countries did not read that thread.
Therefore I like to give it another try, here.
Thanks.

------------------
Egbert Zijlema, journalist and programmer (egbert at egbertzijlema dot nl)
http://www.egbertzijlema.nl/programming.html
*** Opinions expressed here are not necessarily untrue ***

[This message has been edited by Egbert Zijlema (edited January 07, 2006).]

IP: Logged

Eddy Van Esch
Member
posted January 07, 2006 09:03 AM     Click Here to See the Profile for Eddy Van Esch     Edit/Delete Message   Reply w/Quote
Hi Egbert,

I seem to recollect that according to ISO norms, week 1 is the first week of the year that contains the first thursday of January.
Seems to be like that for 2005 and 2006.
I believe that's the reason that 2004 had 53 weeks. Atleast here in Belgium. Don't know about the rest of the world...

Kind regards

------------------
Eddy
email: raimundo4u at yahoo dot com
www.devotechs.com -- HIME Huge Integer Math and Encryption library--

[This message has been edited by Eddy Van Esch (edited January 07, 2006).]

IP: Logged

Eric Pearson
Member
posted January 07, 2006 09:56 AM     Click Here to See the Profile for Eric Pearson     Edit/Delete Message   Reply w/Quote
> is it true that in Belgium, France, Spain and the UK

I don't know about those countries, but in the USA it's an industry thing not a national thing. Some industries traditionally use one system, and other industries use another. For example I come from the TV/radio broadcast industry which defines months as ending on the last Sunday of the calendar month, and week numbers within months are necessarily defined by that standard.

ISO standards are wonderful but not everybody uses them.

-- Eric

[This message has been edited by Eric Pearson (edited January 07, 2006).]

IP: Logged

Egbert Zijlema
Member
posted January 07, 2006 10:01 AM     Click Here to See the Profile for Egbert Zijlema     Edit/Delete Message   Reply w/Quote
Eddy,

This is correct.
But on my box Windows returns "week 1 is the week containing Jan. 1" (with the locale Dutch (Belgium) set).
Try the code that I published in the other thread.

------------------
Egbert Zijlema, journalist and programmer (egbert at egbertzijlema dot nl)
http://www.egbertzijlema.nl/programming.html
*** Opinions expressed here are not necessarily untrue ***

IP: Logged

Donald Darden
Member
posted January 07, 2006 02:29 PM     Click Here to See the Profile for Donald Darden     Edit/Delete Message   Reply w/Quote
As a matter of idle curiosity, is this a matter of real
importance? Assuming that some countries or industriens are
defining week numbers for the year one way or another either
in compliance or defiance of ISO standards - just how critical
or impactive is that?

I can't recall a circumstance where a meeting or shipping date
was defined as falling on the Wednesday of the 38th week of
the year, or anything similar. It's always the day within the
week of the month, or given date.

Obviously, anybody relying on Microsoft code to determine the
week number would likely be getting the same results. However,
if there is a variance from some outside reference, you can
add or subtract a value in Excel to make the two match, but I
don't know of any case where anyone had ever done this.

In fact, I don't know of any case where someone has used Week
of Day for anything beyond projecting the approximate date for a
shipment to arrive, or something like that. But even that was
unlikely since it was easier just to take the number count for
the date and add some offset, such as 30 or 60, and convert
that back to a date and say "on or about" in referring to it.

It might be a matter of interest, but seems somewhat unnecessary
if there is no pronounced need for this particular feature. I
don't think I will be giving it much thought in the future.

------------------
Old Navy Chief, Systems Engineer, Systems Analyst, now semi-retired

IP: Logged

Egbert Zijlema
Member
posted January 07, 2006 02:59 PM     Click Here to See the Profile for Egbert Zijlema     Edit/Delete Message   Reply w/Quote
Hi Donald,

This is, indeed, very important, especially in countries where week numbers are printed on calendar sheets. What if every printing company would use its own rules in this respect? And, as a programmer, how can you produce a calendar with correct week numbers when a call to LocaleInfo returns the wrong values for
%LOCALE_IFIRSTWEEKOFYEAR?

The latter seems to be the case for Belgium. My Windows (XP Home Edition, Service Pack 1) returns 0 for that country, which means: the week that contains the date of January 1 is week number one. Which appears to be wrong, however. In practice, Belgian calendars are printed according to ISO 8601: Monday is the first day of the week and the week that contains the first Thursday of the year (or: contains at least 4 days) is week number one. Hence this rule, January 1 of this year belongs to week 52 of 2005.

Thank you very much Eddy Van Esch for checking this for me.

------------------
Egbert Zijlema, journalist and programmer (egbert at egbertzijlema dot nl)
http://www.egbertzijlema.nl/programming.html
*** Opinions expressed here are not necessarily untrue ***

[This message has been edited by Egbert Zijlema (edited January 07, 2006).]

IP: Logged

Amílcar Matos Pérez
Member
posted January 07, 2006 04:30 PM     Click Here to See the Profile for Amílcar Matos Pérez     Edit/Delete Message   Reply w/Quote
To Donald:
Week numbers are of utmost importance in corporate financial
planning, accounting, auditing and different number crunching
marketing. When you go into international markets you need
to sincronize all your operations, so week numbers are crucial.
Thanks.

------------------

IP: Logged

Egbert Zijlema
Member
posted May 19, 2006 02:18 AM     Click Here to See the Profile for Egbert Zijlema     Edit/Delete Message   Reply w/Quote
Just to inform you: new article and new code at http://www.egbertzijlema.nl/programming.html

------------------
Egbert Zijlema, journalist and programmer (egbert at egbertzijlema dot nl)
http://www.egbertzijlema.nl/programming.html
*** Opinions expressed here are not necessarily untrue ***

IP: Logged

Christopher Carroll
Member
posted May 19, 2006 09:47 PM     Click Here to See the Profile for Christopher Carroll     Edit/Delete Message   Reply w/Quote
http://konsulent.sandelien.no/VB_help/Week/

From the link:

quote:

The .NET GetWeekOfYear() method will NOT produce correct ISO 8601 week numbers regardless of culture or CalendarWeekRule settings. Here is an explanation of the problem, as well as a custom method that does the right calculation.


IP: Logged

Mel Bishop
Member
posted May 19, 2006 10:17 PM     Click Here to See the Profile for Mel Bishop     Edit/Delete Message   Reply w/Quote
So, if I understand this situation correctly, some years contain
week zero and some don't. This doesn't make any sense.

I was under the impression that Jan 1 is the day that immediately
follows Dec 31 of the previous year.

IMO: What difference does it make and who cares.

------------------

IP: Logged

Egbert Zijlema
Member
posted May 20, 2006 10:13 AM     Click Here to See the Profile for Egbert Zijlema     Edit/Delete Message   Reply w/Quote
There is no week zero. According to ISO-rule 8601, weeks can be numbered from 1 to 53 (inclusive).

------------------
Egbert Zijlema, journalist and programmer (egbert at egbertzijlema dot nl)
http://www.egbertzijlema.nl/programming.html
*** Opinions expressed here are not necessarily untrue ***

IP: Logged

Eddy Van Esch
Member
posted May 20, 2006 02:13 PM     Click Here to See the Profile for Eddy Van Esch     Edit/Delete Message   Reply w/Quote
quote:
Originally posted by Mel Bishop:
I was under the impression that Jan 1 is the day that immediately
follows Dec 31 of the previous year.


Yes, but only in leap years !!


quote:
Originally posted by Mel Bishop:
IMO: What difference does it make and who cares.


It makes a difference if you promised a customer to have project X ready in week Y.
Except, if your customer and yourself are using different week numbers it's annoying to find out that your project should have been finished in week Y-1 ...

Kind regards


------------------
Eddy
email: raimundo4u at yahoo dot com
www.devotechs.com -- HIME Huge Integer Math and Encryption library--

IP: Logged

ian mcallister
Member
posted May 20, 2006 05:06 PM     Click Here to See the Profile for ian mcallister     Edit/Delete Message   Reply w/Quote
No

In the UK we only have 1 day per year

That's today

IP: Logged

Mike Stefanik
Member
posted May 20, 2006 05:40 PM     Click Here to See the Profile for Mike Stefanik     Edit/Delete Message   Reply w/Quote
So, when you say that your country is over 900 years old...

------------------
Mike Stefanik
www.catalyst.com
Catalyst Development Corporation

IP: Logged

All times are EasternTime (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | PowerBASIC BASIC Compilers

Copyright © 1999-2005 PowerBASIC, Inc. All Rights Reserved.


Ultimate Bulletin Board 5.45c