09-16-2002 02:22 PM
09-16-2002 03:03 PM
09-16-2002 03:04 PM
11-20-2019 11:31 AM
Given: date/time string: 11/20/2019 11:59:31 AM
Another way is to convert the date/time string back to a Time Stamp cluster.
Then you can do any math you need very easily.
An easy way to get back to Time Stamp format is to use Scan From String function with %T for the format string input. You will see the output 1 for this function change to a Time Stamp cluster.
If you are concatenating a date string with a time string, you must add the date string to the time string (in other words the upper input to the concat function has to be the TIME string, the lower input has to be the DATE string.
11-20-2019 11:45 AM - edited 11-20-2019 11:46 AM
If you convert a time stamp to a double you can do all the math you want on it and convert it back.
11-20-2019 02:46 PM
@RTSLVU wrote:
If you convert a time stamp to a double you can do all the math you want on it and convert it back.
No need for the Timestamp to Double and vv. at all. The arithmetic plus and minus nodes will operate correctly when you try to add or subtract a double (or integer) from a timestamp.
11-20-2019 03:24 PM
@rolfk wrote:
@RTSLVU wrote:
If you convert a time stamp to a double you can do all the math you want on it and convert it back.
No need for the Timestamp to Double and vv. at all. The arithmetic plus and minus nodes will operate correctly when you try to add or subtract a double (or integer) from a timestamp.
Right... But I really detest coercion dots
AKA "Loser Dots" 😛
11-20-2019 03:32 PM - edited 11-20-2019 03:35 PM
Not quite sure where you see coercion dots. This is LabVIEW 2016, but I doubt there is much difference since at least around 8.2. Even then a coercion dot is usually not really anything else than an implicit conversion functions. If you have coercion dots on scalar wires and get rid of them by adding a conversion node, you have basically not gained anything nore lost anything. Of course if you can get rid of coercion dots altogether by changing dataypes consistently throughout a diagram, that is even better. If conversions are unavoidable it is a good idea to do them explicitedly on the scalar wire inside a loop rather than on the array that goes into or out of an autoindexed loop, though.
11-20-2019 03:40 PM
11-20-2019 04:14 PM - edited 11-20-2019 04:17 PM
Since you have saved the data to a text file, I assume you are then reading that file and want to convert that time stamp back to a LabVIEW data type. Try something like this...
The trick is getting the format string to match the format you have save the data as.
After that, as other have pointed out, just simply add or subtract as required.
EDIT: Oops, looks like GPeople beat me too it