Forum

Date/time manipulat...
 

Date/time manipulation in v1.1  

  RSS

(@pbruno3)
Estimable Member Admin
Joined: 2 years ago
Posts: 240
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"
else
print "Nope"
endif

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

Quote
Share: