Date/time manipulat...

Date/time manipulation in v1.1  


Estimable Member Admin
Joined: 3 years ago
Posts: 241
May 1, 2019 1:32 am  

I received a couple of questions about date/time manipulation, so wanted to post up a sample that may shed some light. In this "Test" script example, we define a date/time variable named 'trigger', assign it to a date/time, then print it (to the Output tab). We then define a time variable 'change', and make it one hour. We then define another date/time, and add the 'change' time variable to it, then print it. Finally, we compare the two date/time variables and generate a print out as a result (will always resolve to "Yes" here).

If you wanted to do a comparison to the current time, use the intrinsic 'now' variable (for example: trigger = now). Also, if you wanted to add days rather than hours, you can include days in the time variable (for example: change = 1:00:00:00).

Hopefully this sheds some light. Please let us know if you have any questions, issues, or concerns!

new datetime trigger
trigger = "04-30-2019 10:00:00 PM"
print trigger

new time change
change = 1:00:00
new datetime future
future = trigger + change
print future

if future > trigger
print "Yes"
print "Nope"

stop "Test"
This topic was modified 6 months ago 3 times by pbruno3