Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


mferree
2013-10-08T02:03:33Z
I would like to set a variable at the beginning of a loop with the date and time. Then at the end of the loop I would like to subtract the current date and time from the previously set variable, so I know the run time of each loop. Is there a way for me to do this?
Sponsor
Forum information
Support
2013-10-08T07:17:10Z
Yes, you could use the Set Variable Task at beginning and end of loop.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
mferree
2013-10-08T13:00:43Z
Can I subtract dates and times?
Support
2013-10-09T07:22:18Z
You can subtract by using negative values in this Variable function - for example:

{DATEADD(Minutes|10/9/2013 9:21 AM|M/d/yyyy h:mm tt|10|M/d/yyyy h:mm tt)}
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
mferree
2013-10-14T19:34:12Z
So I cannot subtract dates or times. 2013-10-10T00:00:00 minus 2013-10-09T00:00:00 = 1 day or 24 hours or ...
Support
2013-10-15T07:29:54Z
Originally Posted by: mferree 

So I cannot subtract dates or times. 2013-10-10T00:00:00 minus 2013-10-09T00:00:00 = 1 day or 24 hours or ...



No not now. I am moving this topic to Feature requests. This is probably something we can implement pretty easy.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
jaslo37
2020-04-27T20:56:25Z
I know this is quite an old thread, but was this feature implemented? I'd like to create a condition comparing a file's modified time to the last job execution time. I know there's a "Days between" variable but it would be very helpful to have a "Time between" variable as well (or the ability to add/subtract times as the OP requested).
Support
2020-05-01T17:07:44Z
Originally Posted by: jaslo37 

I know this is quite an old thread, but was this feature implemented? I'd like to create a condition comparing a file's modified time to the last job execution time. I know there's a "Days between" variable but it would be very helpful to have a "Time between" variable as well (or the ability to add/subtract times as the OP requested).



Yes you can subtract using the Dateadd variable, but instead of 10 to add 10, you use -10 to subtract 10
Michael
Support
http://www.visualcron.com 

Please like  VisualCron on facebook!
jaslo37
2020-05-13T15:36:42Z
So my question is just rephrasing the other. Referring to your example, I understand that I can use -10 if I wanted a set time as the value, but I'd like to find the difference between 05:00 and 04:50 (-10 minutes); or the difference between 15:00 and 05:00 (-10 hours). I saw that Henrik had added it to the Feature requests originally but I cannot find that functionality. If this feature cannot be implemented, do you have a workaround I could use?
Scroll to Top