02-25-2006 01:08 AM
02-26-2006 03:55 PM
It's not just Germany or DIN but internationally standardized as ISO. Unfortunately LabVIEW is using the C runtime function strftime which uses ANSI norm (not as international of course!).
marco.wegner@kmw-gmbh.de wrote:
HI,
how can I calculate the proper week number for Germany? So the first week in year is the week with at least four days (Thursday at least 01.01). So I have some problems with leap years and so on. One of the problems is to know that the last days of a year can be in the first week of next year (such as 31.12.2002).
Who can help me?
Thanks and best regards
Marco
02-27-2006 04:40 AM
THANKS A LOT,
that´s it. And it works really fine. What I have tried looks much more difficult (and it doesn´t work...).
Best regards
Marco
02-28-2006 12:49 AM
02-28-2006 01:57 AM
What you did are practical modifications but they are not to the definition of the ISO norm. If you modify week to 1 the supposed date is one week later than what ISO really means and only if you change year to 2005 are you sort of correct.
@JB wrote:Yes, this is a great VI ! Thanks Rolf !However, we have modified it sligthly to handle some strange cases that may occur.One of those strange cases was the first day of this year. The weeknumber was 52 and the year 2006. Although both are correct, you will get an erroneous date if you combine them. In fact, if you label a product with this date, the customer will think that it was produced the last week of 2006.In this case, you must either change the weeknumber to 1 or the year to 2005.There are some other modifications like the input type of the date that we changed to a time stamp control.
02-28-2006 08:00 AM
We usually label our motors with week number and year. Unfortunately, the ISO norm produces unacceptable results (when combining week number and year) for some exceptions, like 01.01.06.
Imagine the reaction of a customer when receiving motors labelled 52/06 in January ! Another problem would appear if the customer shipped motors back for repairing. This indication would lead to think that the motors were produced the last week of 2006.
So we had to adapt your VI to avoid those cases. As you probably noticed, we kept the ISO week number and changed the year when required.
Thank you once again for your work !