ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Format ISO8601

Hi,

 

I have to format a time in ISO8601

 

It should look like: YYYY-MM-DDThh:mm:ssTZD (1997-07-16T19:20:30+01:00)

 

I am able to format it to UTC without the TZD (Time Zone Designator)

 

In Germany there is +01.00 

but now we have summertime +1h so it is equal GMT +00:00

Is there a way to get the TZD in TestStand

 

Juergen 

 

 

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 1 of 10
(7,026 Views)

Hi Jürgen,

 

maybe this helps:

 

Accessing Windows Time Zone Information Through LabVIEW

 

Regards,

Andreas Stark
LabVIEW Lead @ Rocket Factory Augsburg
Message 2 of 10
(7,011 Views)

Juergen,

 

Another reason why you should use LabVIEW rather than that C "what's it stuff"  Smiley Very Happy

Regards
Ray Farmer
Message 3 of 10
(7,007 Views)

Hi Ray,

 

It seems in this case the LabView Example( Thanks Andreas! ) will not fit all my needs.

 

In my Post i did a misstake! About adding the summertime 

I Said if you push 1+  Then GMT(+1) + Summer(+1) = GMT(+0) Seems i have to go back to primary school

a learn some mathematic fundmentals.

 

I need a simple function that gives my local time in against UTC.

Example: 

If you are in Greenwich, New York, Berlin(Winter), Berlin(Summer) and get your local time at THIS moment

 

You will get:

Greenwich       10:20:30+00:00

NY                   05:20:30-05:00

Berlin(Winter)  11:20:30+01:00

Berlin(Sum)     12:20:30+02:00

 

So getting the local time is very simple Teststand Time() will do it!

But now i need to determine should i add +01:00 or +02:00

 

 

Juergen

 

 

 

 

 

 

 

 

     

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 4 of 10
(6,990 Views)

Jürgen,

 

so you don't want to get the local time, but you need to read out the difference to UTC?

 

Regards

Andreas Stark
LabVIEW Lead @ Rocket Factory Augsburg
Message 5 of 10
(6,988 Views)

Hi Andreas,

 

No, I want to get my current local time and the deviation to UTC

 

Here in Germany it is +1:00 (Winter) +2:00(Summer)

 

I need an API that should give me +1:00 / +2:00

or if i am in NY -5:00

 

See this link on chapter 5.3.4.2

http://xml.coverpages.org/ISO-FDIS-8601.pdf

 

Juergen 

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 6 of 10
(6,975 Views)

The mentioned example shows how to read the bias using Windows' kernel32.dll. The function is GetTimeZoneInformation.

 

Regards,

Andreas Stark
LabVIEW Lead @ Rocket Factory Augsburg
Message 7 of 10
(6,971 Views)
I found a bug in the VI for timezones with a positive offset from GMT. The community link is correct, but the vi link points to the old version...
Message 9 of 10
(6,936 Views)

More developement work has been done here and shared as open source project. A very comprehensive set of time zone libraries. You can also find the package via JKI VI Package manager by searching for "Epoch"

 

https://github.com/LabVIEW-Open-Source/Epoch-Time

 

0 Kudos
Message 10 of 10
(2,405 Views)