From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-14-2007 06:06 AM - edited 04-14-2007 06:06 AM
I think the problem is as follows: LabVIEW internally uses UTC to store the seconds but when displaying them always converts them to local time. You can of course adjust for this by subtracting the (calculated) timezone offset from a timestamp and that will display the timestamp as UTC but it will still use local time format and the OS functions to format for that and technically the timestamp Greg would like to see does not exist in local time format so can't really be formatted by the OS functions for local time format.
@TonP wrote:
TBD,
the issue was (as I understood) that Greg couldn't display an UTC time.
The display used local time instead of UTC LabVIEW internally uses UTC and not local time, for display purposes it CAN be converted into local time.
See the following screenshot:
where I put local time in (CET =UTC+2 currently) and output is as UTC, the 'West-Europa (zomertijd)' means LV gets the name of the timezone from the OS (dutch winXP)
Maybe I don't get the problem, but I have the feeling that Greg just set it's computer to London time which uses DST?
Ton
Message Edited by rolfk on 04-14-2007 01:08 PM
04-14-2007 12:24 PM
@tbd wrote:
We could also keep a DST-stripping-solution all-G! (not that i've actually tested this! -)
I haven't followed the thread at all, and I'm not sure entirely what the code does, but I just wanted to point out that had you tested the VI, you would have found out that it will fail for the year 2400.
Years divisible by 400 (1600, 2000, 2400, etc.) are not leap years.
04-14-2007 01:57 PM
And then there is the exeption to the exception that says that every 2000 years or so that exception does not apply. Just check in your calender for February 29, 2000
@tst wrote:
I haven't followed the thread at all, and I'm not sure entirely what the code does, but I just wanted to point out that had you tested the VI, you would have found out that it will fail for the year 2400.
Years divisible by 400 (1600, 2000, 2400, etc.) are not leap years.
04-15-2007 12:00 AM
the issue was (as I understood) that Greg couldn't display an UTC time.
I agree! - but I don't think "^%" always displays "UTC" time! During Daylight Savings Time (in places where it's used) "%^" displays UTC+1 - and that causes the phenomenon: "I cannot display the UTC times that would not be found in local time" (because Greg is in a DST zone).
UTC should allow everyone to agree on what single time it is. By calling "%^" UTC it could create arguments like
> "I'm UTC"!
< No, I'm UTC
> Nooooo, I'M UTC
< No, you think you're UTC, but you're really UTC+1
> ... I think were both UTC!
< er, we're two different times, how can we both be UTC?
.
.
.
< I'm gonna have a beer
> I'm gonna have a lobotomy
< perhaps I'll join you...
04-15-2007 12:09 AM - edited 04-15-2007 12:09 AM
Message Edited by tbd on 04-15-2007 12:21 AM
04-15-2007 12:29 AM
@rolfk wrote:
And then there is the exeption to the exception that says that every 2000 years or so that exception does not apply. Just check in your calender for February 29, 2000
@tst wrote:
I haven't followed the thread at all, and I'm not sure entirely what the code does, but I just wanted to point out that had you tested the VI, you would have found out that it will fail for the year 2400.
Years divisible by 400 (1600, 2000, 2400, etc.) are not leap years.
Rolf Kalbermatter
Hi Rolf,
Your right, and I think tst is wrong! (amazing and unusual as it may be.) Years divisible by 400 ARE leap-years (unless they fall under the 2000 year exception.) So 1600 and 2400 will be (maybe I better mark 2400 in my calendar, so I don't forget - )
Cheers.
04-15-2007 02:17 AM
@tbd wrote:
I highly suspect that NI choose to base their dates at 1904 because 1900 isn't a leap-year - making the seconds-to-date-calcs somewhat simpler.
As far as I know, LV uses 1904 as the epoch because that's what the Mac used. Apple may have chosen it for that reason.
Microsoft used 1900, but had some sort of trick to handle feb 1900.
In any case, Rolf was not contradicting me (in the same way that I was not contradicting you). He simply added another exception.
Also, if I understand correctly, LV functions should work properly for 8.x even after 2040. Don't they?
04-15-2007 11:21 AM - edited 04-15-2007 11:21 AM
@tbd wrote:but I don't think "^%" always displays "UTC" time! During Daylight Savings Time (in places where it's used) "%^" displays UTC+1 - and that causes the phenomenon: "I cannot display the UTC times that would not be found in local time" (because Greg is in a DST zone).
Message Edited by TonP on 04-15-2007 06:23 PM
04-15-2007 12:57 PM - edited 04-15-2007 12:57 PM
Well after some more thinking I believe I have to contradict you anyhow. 😉
@tst wrote:
@tbd wrote:
I highly suspect that NI choose to base their dates at 1904 because 1900 isn't a leap-year - making the seconds-to-date-calcs somewhat simpler.
As far as I know, LV uses 1904 as the epoch because that's what the Mac used. Apple may have chosen it for that reason.
Microsoft used 1900, but had some sort of trick to handle feb 1900.
In any case, Rolf was not contradicting me (in the same way that I was not contradicting you). He simply added another exception.
Also, if I understand correctly, LV functions should work properly for 8.x even after 2040. Don't they?
Message Edited by rolfk on 04-15-2007 08:02 PM
04-15-2007 08:01 PM
Hi TonP,
It looks like you're right - under 8.2, and I'm right under 7.1. I recently installed 8.2 and just couldn't reproduce results to contradict you - even using the example I posted just for the purpose! Then I tried the example under 7.1 and presto! - a (chart-X-scale) leap even using "%^".
5 stars for your patience. (now where's that beer...)
Cheers!