09-04-2015 06:41 AM
Hi,
When it shows the time that have past since the program starts, it start with "1" in the hour area though it only ran for 30 seconds.
How do i corret that, so it start with 0?
Thanks in advance.
09-04-2015 07:03 AM
What timezone are you in? I think the Seconds to Date/Time might be trying to convert it to your local timezone which is adding an hour. Try wiring a 'true' to the 'is UTC' input and see if that gives the correct results.
If you're just displaying the elapsed time, you can save some code by leaving it as a DBL numeric and change the display format to 'relative time'. You can also do something similar with the format into string to and the relative time format code to display in a string indicator.
09-04-2015 07:12 AM
Of course an easier method if you really just want to display the hours, minutes, and seconds, is to just show that as a custom format in a numeric indicator.
Attached is a VI that just subtracts time from the start time, which is then returned as a double just like your code. But then I just have an indicator showing this in the form of HH:MM:SS.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-04-2015 07:13 AM
Thanks, it work with the a true to the UTC. And I already change it to the scenario with format into string and show it in a indicator.
But it shows 01.01.1904, is it because of my time zone or and how do i fix this?
I live in Denmark and the timezone is GMT + 2:00..
09-04-2015 07:26 AM
Look at the format codes for format into string - you can change how it is displayed by using %<%H:%M:%S>t (I haven't looked it up but it's something similar to that for relative time).
09-04-2015 07:39 AM - edited 09-04-2015 07:39 AM
@08anja wrote:
But it shows 01.01.1904, is it because of my time zone or and how do i fix this?
Looks like you chose to show the date instead of the time. Your display property dialog should look like this.
09-04-2015 07:57 AM
That seems to be working and good for my further coding because I need to save it in a txt file, and now I have it as a string when I use Format Date/time String..
That will be it for now, thanks everybody and may you have a good weekend
09-04-2015 09:51 AM
08anja, there seems to be something important which you did not understand - absolute time is used to represent specific points in time in an unambiguous way. Relative time is used to measure time differences.
Everything you're doing is in absolute time, which is conceptually wrong. You need to use relative time, as the others have shown. You should have no timestamps and no date/time rec clusters.