LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Date-time conventions

Thanks Waldemar

I have already given up this "week" stuff. It will never work.

I still do not understand why Germany changed law to have Monday as a first week, since US standrard was Sunday.

regards
Pawel
0 Kudos
Message 21 of 40
(6,229 Views)
Pawel,

before the ISO rules were law in Germany the first day of the week was Sunday. ISO made Monday the first day of the week. In Germany normative standards, like the one of ISO which have been adopted by DIN, have the state of a law. DIN is the normative institution in Germany.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 22 of 40
(6,216 Views)
pawel wrote:

> Thanks madness,<br><br>It is indeed a part of my problem. The other part is the week number. Today e.g. we have 2004-12-09, which by LV is reported as week 49. In Denmark this is a week 50th, and no year can have week 0. I need to find a trick for that as well.<br><br>Thanks a lot<br>Pawel

How about incrementing the LabVIEW supplied week by one for starters? Of
course you also need to take into account the case when you want to know
the week on a Sunday which LabVIEW will report with the same week
number as you are using in Denmark.

So something like:

if (LabVIEW day == 0)
week = LabVIEW week
else
week = LabVIEW week + 1


should do the trick, won't it?

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
0 Kudos
Message 23 of 40
(6,356 Views)
pawel wrote:

> Thanks Waldemar<br><br>I have already given up this "week" stuff. It will never work.<br><br>I still do not understand why Germany changed law to have Monday as a first week, since US standrard was Sunday. <br><br>regards<br>Pawel

Actually it is possible. Look at attached VI which returns a data/time
cluster with the weekday adjusted for ISO definition as well as an
additional week number according to the ISO definition.

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
0 Kudos
Message 24 of 40
(6,186 Views)
Hi Rolf

I am very interested in this vi, can you post it on this newsgroup. (You forgot it last time 🙂

regards
Pawel
0 Kudos
Message 25 of 40
(6,181 Views)


@pawel wrote:
Hi Rolf

I am very interested in this vi, can you post it on this newsgroup. (You forgot it last time 🙂

regards
Pawel




No I didn't forget. I posted it from my NNTP client and in there the attachment shows up nicely. So it must be another problem with the synchronization between the NNTP feed and the new Developer Exchange discussion forums. As far as that goes, toegether with the problems of non-working links in old posts, disappearing text because of html interpretation where no html was meant, the new forum software certainly is a step backwards.

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
Message 26 of 40
(6,175 Views)
Hi Rolf

Thanks a lot. I got it now.

I agree with you about the new layout of this newsgroup. I expressed it several times til now, but the majority of this commune seems to think otherwise. There are a lot of things I do not like, especially in that kind of long threads like this one. The relationship between posts is totally destructed.

Thanks again for the vi. I will check it soon, since right now I do not have my machine.

regards
Pawel
0 Kudos
Message 27 of 40
(6,168 Views)
Dear Rolf

I meant that there is no simple solution using Format Date/Time function which seems to be true since you used it not.

Thanks for the VI. I planned to create a similar one using the same appproach with the mod 7 of day of year operation.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 28 of 40
(6,143 Views)
Hi Rolf

It works very nice. Congratulations.

kind regards
Pawel
0 Kudos
Message 29 of 40
(6,131 Views)

Hi,

I'm a bit of a latecomer to this discussion, but I have a need to get the fiscal week of the year (ISO 8601). After downloading the "ISO Week Number.vi" and testing the crossover dates of December 31st and January 1st over a number of years, I found that it had problems with 8 of every 28 years (all involving leap years). I used the calendar at http://timeanddate.com/calendar/ to verify the week and day numbering. That calendar can be set to display the ISO 8601 week numbers and just about any calendar format. The original VI

from Rolf Kalbermatter was a great start and I appreciate the start that it gave me but it took a quite a bit of time to test (although the fixes were quick) and to get it to where it would be useful to me. So, I am going to post a new version that should be more useful to others as well.

I corrected the year end transition week numbering problems and also added additional code to synchronize the year with the week on the output.

The original VI returned a date/time cluster with the weekday adjusted for ISO definition as well as an additional week number according to the ISO definition. I added year number and day of week number outputs wired to the connector and updated the year in the date/time cluster. I disconnected the date/time cluster from the connector since the month, day of month, and day of year are still not synchronized to the ISO 8601 calendar (and it seems to depend somewhat on the accounting system used.) Anyway the year, week of year, and day of week are all accounted for in my VI. I am also including the test routine I used to show both the December 31st and January 1st ISO 8601 dates at the same time for testing.

Paul Eshman


Download All
Message 30 of 40
(5,942 Views)