02-03-2016 06:12 AM
Hello,
I am solving some issue with Labview and I find quite interesting bug.
It is just time conversation from string to datetime format.
In the picture below I made 24 times this conversation to show, what the result is for each hour of the day.
It looks like labview have some problem with conversation times in format 2:XX:XX (I mean, when number 2 is the first).
Has anyone any idea, how to solve that bug?
Solved! Go to Solution.
02-03-2016 06:20 AM - edited 02-03-2016 06:22 AM
Hi vasicek,
well, it appears to correlate with changing from "standard" time to daylight savings time (last Sunday in March & October for great parts of Europe)…
Remember: the timestamp indicator will always (or: by default) adapt to your local OS timezone settings!
02-03-2016 07:15 AM
Thanks for your reply!
I think that you are right, it is a time change, but is there any possibility to avoid that thing? I mean, I wanna use "the missing hour" in my code, is it possible?
Thanks!
02-03-2016 07:21 AM
The problem is the hour isn't really "missing". It never exists.
So what do you mean by using the "missing" hour? You might need to modify your code to account for that. Or you might want to modify your code so it outputs the values in terms of Greenwich Mean Time or Universal Time.
02-03-2016 07:34 AM
That hour exists! in many countries for example...
My goal is get the same time in timestamp as I setted in string...even if the timechange is occur.
Thank you!
02-03-2016 07:37 AM
@vasicekv wrote:My goal is get the same time in timestamp as I setted in string...even if the timechange is occur.
Then you need to standardize on UTC time.
02-03-2016 07:44 AM
@vasicekv wrote:That hour exists! in many countries for example...
My goal is get the same time in timestamp as I setted in string...even if the timechange is occur.
Thank you!
No. It doesn't. One day a year has 23 hours. One day a year has 25 hours. 2:00-3:00 am hour doesn't exist when clocks jump forward at 2am in the spring. The 1:00-2:00 am hour exists twice when clocks jump back in the fall.
If you are in a country that doesn't have daylight savings time, then that would be reflected in your PC settings and the behavior of the missing hour or extra hour would not show up.
02-03-2016 07:53 AM
Please, we should be focused on the problem.
The easiest explanation of my problem again: I have time string "29.3.2015 2:10:00.000" and I wanna convert it to timestamp with the same time, but the result is now one hour lower because of timechange.
Is there some easy way, how to solve that? Should I change some settings somewhere?
Thanks for your reply!
02-03-2016 08:21 AM
02-11-2016 01:34 AM
The solution is:
1.convert variant to string
2.string convert to variant with format string %^<%d.%m.%Y %H:%M:%S>T, where ^ is important
3.use Format Date/Time String.vi with UTC set to True