Jump to content
Peter_S

Save Timestamp as UTC xml string?

Recommended Posts

Peter,

 

You can easily convert the timestamp in UTC xml string by using "Easy Write XML File" function. Just wire the timestamp and destination file path to it.

Share this post


Link to post
Share on other sites

Hi Ashish,

then I get the local time with UTC offset ( which is not correct because the 1 hour DST offset is missing):

<Time_Stamp>2014-05-13T13:40:36.121+01:00</Time_Stamp>

 

The UTC Format <Time_Stamp>2014-05-13T11:40:36.121Z</Time_Stamp> is not possible?

 

Peter

Share this post


Link to post
Share on other sites

Peter,

 

You can use the "Format Date/Time String" function to build the desired UTC format string and then use EasyXML to generate the XML string.

 

See attached snippet for reference.

 

Here is the time format string I created: %Y-%m-%dT%H:%M:%S%3uZ

UTC_Time_Format.png

Share this post


Link to post
Share on other sites

I know. But why I use EasyXML. It can create XML from clusters:

easyxml.png

 

But the UTC Offset was in September +02:00 ! Easy XML use not UTC Offset from the time value.

 

And you see I fixed the bug "Timestamp decimal is no period".

 

For my LV 2012 installation I fixed also your UTC offset bug. So correct is:

 

 

easyxml2012.png

 

The problem was: I had to read the times in c# and with your bug is an hour offset!

 

It would be very usefull, also for other users, if you fix the bugs in the offical packages (eval + registered).

Share this post


Link to post
Share on other sites

Peter,

 

I have created the exact VI as you showed in the image , but it is not updating the adjustments of UTC . In that image in front panel inside "data" is the result you are getting or are you showing the expected result you want ? Because by following your steps I am not getting the desired output. I am attaching my VI please check where I am going wrong.

 

Thanks

 

utc.vi

 

I know. But why I use EasyXML. It can create XML from clusters:

easyxml.png

 

But the UTC Offset was in September +02:00 ! Easy XML use not UTC Offset from the time value.

 

And you see I fixed the bug "Timestamp decimal is no period".

 

For my LV 2012 installation I fixed also your UTC offset bug. So correct is:

 

 

easyxml2012.png

 

The problem was: I had to read the times in c# and with your bug is an hour offset!

 

It would be very usefull, also for other users, if you fix the bugs in the offical packages (eval + registered).

Edited by Vikas Barai

Share this post


Link to post
Share on other sites

I have created the exact VI as you showed in the image , but it is not updating the adjustments of UTC . In that image in front panel inside "data" is the result you are getting or are you showing the expected result you want ? Because by following your steps I am not getting the desired output.

 

Hi Vikas,

in the official EasyXML Package is the bug: the utc offset doesn't depend of the input time.

It is calculated from a fixed date (1/1/1904). For me in europe it is always +01. But for a time inside daylight saving it should +02.

For me I fixed this UTC offset bug ( remove vi password - see hmilch.net, search the bug, fix the bug...)

Easyxml is closed source, so I can not publish the fix.

 

Peter

Share this post


Link to post
Share on other sites

Hi Peter,

 

I have the same issue writing timestamp to xml using the toolkit but am unsure on how you got around it?? I have also contacted the JKI team to see if there will be a fix to the toolkit. It is causing me a lot of headaches, would you mind sharing your workaround in a little more detail so that I may possible do the same??

 

Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use.