From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time stamp with 0 as time

Solved!
Go to solution

Hello,

 I am developing a program to search by date.  I am using the time stamp control.  The problem is when I select a date it outputs the current time as well.

 

How do I set the time to 0?

 

Thanks

Dan Shangraw, P.E.


   

0 Kudos
Message 1 of 6
(3,654 Views)

Time = 0 has a special meaning.  It is the epoch for LabVIEW which is Jan 1, 1904 Midnight GMT.

 

What do you want time = 0 to mean for you?

 

You can edit the display format properties for time stamp controls to turn off the time or date from being displayed.  You can also set a double numeric indicator to show times and dates as well.

0 Kudos
Message 2 of 6
(3,638 Views)
Solution
Accepted by topic author ASTDan

There are a couple of functions in the Timing palette you should have a look at.  They convert a timestamp into a cluster and back.  You can just set the time in that cluster.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 6
(3,635 Views)

That did the trick.  I did find I have to set the hour to 1 to get 12:00 AM setting it to 0 it thought it was the day before.

 

Thanks!

Dan Shangraw, P.E.


   

0 Kudos
Message 4 of 6
(3,625 Views)
Solution
Accepted by topic author ASTDan

@ASTDan wrote:

That did the trick.  I did find I have to set the hour to 1 to get 12:00 AM setting it to 0 it thought it was the day before.


That sounds like a Time Zone issue.  I know there are options in there for UTC or not.  Might want to make sure those are set to not be UTC.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 6
(3,593 Views)

Thanks for the tip.

 

I set UTC to True and was able to set the hour to 0

 

Thanks so much!

Dan Shangraw, P.E.


   

0 Kudos
Message 6 of 6
(3,588 Views)