06-09-2023 03:37 AM
Personally I have my own special conversion function that uses always %^<%Y-%m-%dT%H:%M:%S>T and then scans the remainder of the string for either a Z character (in which case I'm done) or for a %d:%d tuple which then is converted into seconds and added to the resulting timestamp.
If no Z, +, or - follows directly the timestamp it is assumed to be in local time by calculating the local timezone offset for the just generated timestamp and adding that to it. Yes that timestamp could have been generated in a different timezone and really mean a different time in absolute universal time, but hey we have to live with the information we have, I can't invent non-existing information!
06-09-2023 08:08 AM
@rolfk wrote:
Yes that timestamp could have been generated in a different timezone and really mean a different time in absolute universal time, but hey we have to live with the information we have, I can't invent non-existing information!
Sure you can, Rolf -- if not you, then Who?
Bob Schor
06-12-2023 03:05 AM
@Bob_Schor wrote:
@rolfk wrote:
Yes that timestamp could have been generated in a different timezone and really mean a different time in absolute universal time, but hey we have to live with the information we have, I can't invent non-existing information!
Sure you can, Rolf -- if not you, then Who?
Bob Schor
If you store UTC and GMT time different (and daylight saving correction info), you can correct for this.
It's somewhat surprising that timestamps are often ignored by customers.
Sometimes there's just no way around it...
If the data 'travels' around the world, you better think this through in advance. UTC is consistent, but not very user friendly. If a measurement was done at lunch, you might want to see lunch times. However, if you want to synchronize data with local measurements, you might want to show the data as local time.
It can get very difficult. It's esp. difficult to explain to customers\users why it's difficult.
06-12-2023 03:20 AM
wiebe@CARYA wrote:
@Yamaeda wrote:
@mshaska wrote:
How do I format 03-31-23 15:44 into a time stamp format?
Something like %<dd-mm-YY HH:MM>T
%<%d-%m-%Y %H:%M>T actually.
That's what happens when you write from a bad memory. 🙂
06-12-2023 04:01 AM
@Yamaeda wrote:
wiebe@CARYA wrote:
@Yamaeda wrote:
@mshaska wrote:
How do I format 03-31-23 15:44 into a time stamp format?
Something like %<dd-mm-YY HH:MM>T
%<%d-%m-%Y %H:%M>T actually.
That's what happens when you write from a bad memory. 🙂
I still look them up...
We could have a lengthy discussion on how to find them easily. I drop a Format Date/Time String, Detailed Help, Time Format Codes (at the bottom).
Finding them through the format into string or scan from string function's detailed help is harder (Detailed Help, Format Strings, Format Codes for the Time Format String (under "<Embedded Time Format> (optional)>").
06-12-2023 04:57 AM
Not sure what is the problem, but I just tried to send an answer and the mighty Cloudflare service seems to really dislike something about me. 😁
Was just saying that I handle it as Wiebe. No matter what I try, I end up being in doubt every time again and have to look it up anyhow. 😁
06-12-2023 06:58 AM
@rolfk wrote:
Not sure what is the problem, but I just tried to send an answer and the mighty Cloudflare service seems to really dislike something about me. 😁
I got that too: You have been blocked? - NI Community
Must be the way we lookup time formatting 😂.
06-12-2023 09:41 AM
wiebe@CARYA wrote:
We would have a lengthy discussion on how to find them easily. I drop a Format Date/Time String, Detailed Help, Time Format Codes (at the bottom).
Finding them through the format into string or scan from string function's detailed help is harder (Detailed Help, Format Strings, Format Codes for the Time Format String (under "<Embedded Time Format> (optional)>").
Hear, hear! Is there any other way? 🙂