09-03-2020 11:07 AM
i am writing a program to count the days and hours remaining. I used the time stamp to set the end time, then I subtracted the Get date / time seconds to get the result but it didn't work as I expected. I use the Format date / time string to give a counter but it only holds true when I set the time back about 60 minutes. I want the output to be days, hours and seconds left.
Can anyone help me with this problem?
Thank all
Solved! Go to Solution.
09-03-2020 11:53 AM
No.
While you put put into writing what you did, it really doesn't show us what you actually did.
Now if you had attached a VI, we could see what you actually did and be able to figure out why it isn't working the way you want and what needs to be fixed.
09-03-2020 11:59 AM
I would like to attach my vi file, i am using Labview 2018
Thank you for reply
09-03-2020 01:07 PM - edited 09-03-2020 01:08 PM
What timezone are you in?
Any chance you are 1 hour (I'm going to guess +1) relative to GMT?
Notice you have an input on Format Date/Time String that you did not wire called "UTC Format". It defaults to false. If I change it to true then it works better. But when it counts down to zero, it wraps around and starts counting down from 23:59:59
There is a much easier way to do a countdown timer. Just do the subtraction and write it to a numeric indicator. Set the indicator's display format to relative time.
Note, your Time Stamp control is outside the loop which means must be set before the VI starts because it is read immediately and just that one time. No way to change your time target unless you stop the VI, change it, then restart it. I moved it into the loop.