10-22-2022 05:30 AM
Hello all,
I would like to add seconds to a timestamp in a string.
For example,
"2022/10/21 09:55:03.734" +2.5s = "2022/10/21 09:55:06.234"
"2022/10/21 09:55:03.734" +305.6s = "2022/10/21 10:00:09.334"
In C# programming, it would be super easy since I could parse the string as a DateTime object and then use the "addseconds" function.
Are there any functions (I didn't find any) which could help to make it easy in TestStand?
Or have I no other possibilities than coding this logic myself? Which is of course possible but a bit messy.
Best regards,
Ludovic
12-23-2022 08:30 AM
Dear Lchar,
There is no such function in testand, however you can convert your time to number add the seconds and then convert back. Here's a forum post for converting time to number https://forums.ni.com/t5/NI-TestStand/Calculate-with-timestamps-in-string-format/td-p/231843.
best,
anasei.
12-24-2022 01:54 AM
You can use C# as well. DateTime object methods are at your fingertips.