LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cleanest way to add a second to date/time?

I have a bunch of singles with the date and time in them from year down to tenths of milliseconds.  I want to add 1 second and have the rest update.  This is the cleanest way I've come up with.  I'm not too fond of the bundling and unbundling but I can't think of another way.  Anyone have an easier/faster/cleaner way?
 
Lee Jay
 
 
0 Kudos
Message 1 of 17
(3,940 Views)
Hi Lee Jay,

do you have to use this format (splitted into several data types)?
Because the time stamp format is easier to handle (and you could easily add 1 second). With the formatting variaty you can almost do everything with timestamps.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 17
(3,930 Views)

Yes, I must use the split-out format.

Lee Jay

0 Kudos
Message 3 of 17
(3,920 Views)
Lee Jay,

If the original value of Seconds = 59, does your code do what you want? You may need to propagate overflow throughout the cluster.

Lynn
0 Kudos
Message 4 of 17
(3,917 Views)

Yes, the whole point of doing this is to get minutes, hours etc. to roll over properly.  And this code does work for that.

Lee Jay

0 Kudos
Message 5 of 17
(3,909 Views)

By the way, adding 1 after the conversion works the same.

Lee Jay

0 Kudos
Message 6 of 17
(3,904 Views)

Maybe I'm missing something, but isn't just adding 1 second like in the attached example what you want to do?

 

0 Kudos
Message 7 of 17
(3,892 Views)
That's exactly what I'm doing, but I have to start and end with each component of time/date in individual singles.
 
Lee Jay
0 Kudos
Message 8 of 17
(3,880 Views)

Lee_Jay,

I think all that you really need to do is add 1 to your timestamp.  I've attached a quick example.

Hope this helps,
Dan

0 Kudos
Message 9 of 17
(3,883 Views)
I don't have a time stamp.  I have 7 singles and I need to end up with 7 singles.  That's the problem.
 
Lee Jay
0 Kudos
Message 10 of 17
(3,871 Views)