Hi
I am using an excel with my script to do bulk transactions in our MRP system. So if the excel has 697 records to transact and with each loop it takes 15 seconds for each record to process. This would be a total of 10,455 seconds or approx 174 minutes. After my script cycles a record the remaining seconds drops by 15 and the minutes remaining are calculated as well going down in time.
What I am trying to do is add the minutes remaining to come up with an EndTime. Trying to add the minutes(minremain) to the Gettime> function.
//this code does not work
Gettime>now
Let>minremain=174
Let>Endtime=%now%+%minremain%
MDL>Endtime
//My error Looks like this 9:52:33 AM+174
So I need to clean up the time and remove the seconds but add minutes to the Now variable so the shows me the future End Time based on the minutes remaining. It is also possible to have almost 1000 records so the minutes remaining might be close to 250 minutes that I need to add the Now..... for the Endtime
Can this be done? Please any ideas? Is there a sample of similar code?
Calculate End Time from Gettime>
Moderators: Dorian (MJT support), JRL
Calculate End Time from Gettime>
Just when you thought it was safe to go in the water........
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Calculate End Time from Gettime>
There you go :
Some links for you :
Date/Time Commands
TimeAdd
Code: Select all
Gettime>now
Let>minremain=174
TimeAdd>%now%,M,%minremain%,EndTime
MDL>Endtime
Date/Time Commands
TimeAdd
Yes, we have a Custom Scripting Service. Message me or go here
Re: Calculate End Time from Gettime>
Ah interesting. Shorter than I thought but, it is not working for me. So the machine I use scripting is offline because its an older os(win7) that has network vulnerabilities and it is Macro version 12.1.10Dorian (MJT support) wrote: ↑Wed Jan 05, 2022 4:01 pmThere you go :
Some links for you :Code: Select all
Gettime>now Let>minremain=174 TimeAdd>%now%,M,%minremain%,EndTime MDL>Endtime
Date/Time Commands
TimeAdd
I see this is a v15 manual. Do you recall what version the (TimeAdd) command was added?
With the newer OS(win10) etc... there are security timeouts that can't be shut off from IT and running scripts do not seem to be acknowledged by the system so the screen locks and messes up the script.
Additional note is that I can't "thank you guys" enough for all the quick support you provide. It really helps us alot since coding sometimes takes forever to get something working with so many different systems and variables.
Just when you thought it was safe to go in the water........
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Calculate End Time from Gettime>
From the Version History page it looks like TimeAdd was added in 2011 in v13. Your version is over a decade old and no longer supported.
Yes, we have a Custom Scripting Service. Message me or go here
Re: Calculate End Time from Gettime>
Oh yes, I've found that I had the newer version downloaded, just never upgraded that version on the PC.Dorian (MJT support) wrote: ↑Wed Jan 05, 2022 6:20 pmFrom the Version History page it looks like TimeAdd was added in 2011 in v13. Your version is over a decade old and no longer supported.
Thank you!!!
Just when you thought it was safe to go in the water........
- Dorian (MJT support)
- Automation Wizard
- Posts: 1389
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Calculate End Time from Gettime>
Excellent news!
Yes, we have a Custom Scripting Service. Message me or go here