LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Date and time counter remaining

Solved!
Go to solution

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

0 Kudos
Message 1 of 4
(1,584 Views)

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.

0 Kudos
Message 2 of 4
(1,574 Views)

I would like to attach my vi file, i am using Labview 2018

Thank you for reply

 

0 Kudos
Message 3 of 4
(1,568 Views)
Solution
Accepted by topic author Vu_Anh

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.

 

Message 4 of 4
(1,542 Views)