add minutes (whole number) in time to batch-file
I want to put a whole number (these numbers will always represent minutes) and that adds to the current time to use it in the SCHTASKS command. Example if it is currently 14:56:03 i put 9 or 09 in var1 should set 15:05:03 in var2. I have this candy
@echo OFF
echo add minutes
set/p "var1=>"
set/a "var2=%var1%+%time%"
SCHTASKS /change /sd %date% /st %var2% /tn task
I understand that this does not work but I do not know how to do it. Any ideas?
windows batch-file schtasks
add a comment |
I want to put a whole number (these numbers will always represent minutes) and that adds to the current time to use it in the SCHTASKS command. Example if it is currently 14:56:03 i put 9 or 09 in var1 should set 15:05:03 in var2. I have this candy
@echo OFF
echo add minutes
set/p "var1=>"
set/a "var2=%var1%+%time%"
SCHTASKS /change /sd %date% /st %var2% /tn task
I understand that this does not work but I do not know how to do it. Any ideas?
windows batch-file schtasks
2
Use PowerShell, even from your batch file if necessary. It has methods of adding/subtracting from the time.
– Compo
Nov 14 '18 at 11:15
add a comment |
I want to put a whole number (these numbers will always represent minutes) and that adds to the current time to use it in the SCHTASKS command. Example if it is currently 14:56:03 i put 9 or 09 in var1 should set 15:05:03 in var2. I have this candy
@echo OFF
echo add minutes
set/p "var1=>"
set/a "var2=%var1%+%time%"
SCHTASKS /change /sd %date% /st %var2% /tn task
I understand that this does not work but I do not know how to do it. Any ideas?
windows batch-file schtasks
I want to put a whole number (these numbers will always represent minutes) and that adds to the current time to use it in the SCHTASKS command. Example if it is currently 14:56:03 i put 9 or 09 in var1 should set 15:05:03 in var2. I have this candy
@echo OFF
echo add minutes
set/p "var1=>"
set/a "var2=%var1%+%time%"
SCHTASKS /change /sd %date% /st %var2% /tn task
I understand that this does not work but I do not know how to do it. Any ideas?
windows batch-file schtasks
windows batch-file schtasks
asked Nov 14 '18 at 10:37
TechnomancerTechnomancer
133
133
2
Use PowerShell, even from your batch file if necessary. It has methods of adding/subtracting from the time.
– Compo
Nov 14 '18 at 11:15
add a comment |
2
Use PowerShell, even from your batch file if necessary. It has methods of adding/subtracting from the time.
– Compo
Nov 14 '18 at 11:15
2
2
Use PowerShell, even from your batch file if necessary. It has methods of adding/subtracting from the time.
– Compo
Nov 14 '18 at 11:15
Use PowerShell, even from your batch file if necessary. It has methods of adding/subtracting from the time.
– Compo
Nov 14 '18 at 11:15
add a comment |
2 Answers
2
active
oldest
votes
As the entered minute offset could also change the date,
I'd let PowerShell do the calculation
@echo off
set /p "var1=enter minutes to add: "
for /f "tokens=1*" %%A in ('
powershell -NoP -C "(Get-Date).AddMinutes(%var1%).ToString('yyyy/MM/dd HH:mm:ss')"
') do (
Set "MyDate=%%A"
set "MyTime=%%B"
)
echo SCHTASKS /change /sd %MyDate% /st %MyTime% /tn task
Format of the date dd/MM/yyyy to work with schtasks. This solution is the one I like the most precisely because it also solves the day although I did not mention it in the question. Thank you :D
– Technomancer
Nov 14 '18 at 15:57
I do not understand why this always set 00 seconds in the tasks ... example in the echo mytimes shows 18:03:22 and in the task has put 18:03:00
– Technomancer
Nov 14 '18 at 17:05
May be an issue with schtasks itself, the helpschtasks /change /?
just mentions hours:minutes with/st
– LotPings
Nov 14 '18 at 17:13
That's what I thought :(
– Technomancer
Nov 14 '18 at 18:03
add a comment |
I combined the methods posted at this answer in order to complete this request:
@echo OFF
echo add minutes to %time%
set/p "var1=>"
for /F "tokens=1-3 delims=:.," %%a in ("%time%") do set /A "new=(%%a*60+1%%b-100+var1)*60+1%%c-100"
set /A "ss=new%%60+100,new/=60,mm=new%%60+100,hh=new/60,hh-=hh*!(hh-24)"
set "var2=%hh%:%mm:~1%:%ss:~1%"
ECHO SCHTASKS /change /sd %date% /st %var2% /tn task
EDIT: Change to next day added
The next code also uses the method described at this answer to adjust the date part to the next day when necessary:
@echo OFF
setlocal
echo add minutes
set/p "var1=>"
for /F "tokens=2 delims==" %%a in ('wmic OS Get LocalDateTime /value') do set "dt=%%a"
set /A "D=%dt:~0,8%, MM=1%dt:~4,2%-100, newS=((1%dt:~8,2%-100)*60+1%dt:~10,2%-100+var1)*60+1%dt:~12,2%-100"
set /A "s=newS%%60+100,newS/=60,m=newS%%60+100,h=newS/60,newDD=h/24,h%%=24"
if %newDD% neq 0 (
set /A "newMM=!( 1%D:~6%-(130+(MM+MM/8)%%2+!(MM-2)*(!(%D:~0,4%%%4)-2)) ), lastMM=!(1%D:~4,2%-112), newYYYY=newMM*lastMM"
set /A "MM+=newMM*(1-lastMM*12), D+=newYYYY*(20100-1%D:~4%) + !newYYYY*newMM*(100*MM+10000-1%D:~4%) + newDD"
)
set "var2=%h%:%m:~1%:%s:~1%" & set "var3=%D:~6,2%/%D:~4,2%/%D:~0,4%"
ECHO SCHTASKS /change /sd %var3% /st %var2% /tn task
I was going to ammend my answer to fix the octal issue, but this solution works.
– Gerhard Barnard
Nov 14 '18 at 14:47
It works perfectly, I would like to give a better answer to all. Really thank.
– Technomancer
Nov 14 '18 at 15:31
IMHO it is not fair to select the best answer based on an unrequested feature...:/
See my edit.
– Aacini
Nov 15 '18 at 6:38
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53298208%2fadd-minutes-whole-number-in-time-to-batch-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
As the entered minute offset could also change the date,
I'd let PowerShell do the calculation
@echo off
set /p "var1=enter minutes to add: "
for /f "tokens=1*" %%A in ('
powershell -NoP -C "(Get-Date).AddMinutes(%var1%).ToString('yyyy/MM/dd HH:mm:ss')"
') do (
Set "MyDate=%%A"
set "MyTime=%%B"
)
echo SCHTASKS /change /sd %MyDate% /st %MyTime% /tn task
Format of the date dd/MM/yyyy to work with schtasks. This solution is the one I like the most precisely because it also solves the day although I did not mention it in the question. Thank you :D
– Technomancer
Nov 14 '18 at 15:57
I do not understand why this always set 00 seconds in the tasks ... example in the echo mytimes shows 18:03:22 and in the task has put 18:03:00
– Technomancer
Nov 14 '18 at 17:05
May be an issue with schtasks itself, the helpschtasks /change /?
just mentions hours:minutes with/st
– LotPings
Nov 14 '18 at 17:13
That's what I thought :(
– Technomancer
Nov 14 '18 at 18:03
add a comment |
As the entered minute offset could also change the date,
I'd let PowerShell do the calculation
@echo off
set /p "var1=enter minutes to add: "
for /f "tokens=1*" %%A in ('
powershell -NoP -C "(Get-Date).AddMinutes(%var1%).ToString('yyyy/MM/dd HH:mm:ss')"
') do (
Set "MyDate=%%A"
set "MyTime=%%B"
)
echo SCHTASKS /change /sd %MyDate% /st %MyTime% /tn task
Format of the date dd/MM/yyyy to work with schtasks. This solution is the one I like the most precisely because it also solves the day although I did not mention it in the question. Thank you :D
– Technomancer
Nov 14 '18 at 15:57
I do not understand why this always set 00 seconds in the tasks ... example in the echo mytimes shows 18:03:22 and in the task has put 18:03:00
– Technomancer
Nov 14 '18 at 17:05
May be an issue with schtasks itself, the helpschtasks /change /?
just mentions hours:minutes with/st
– LotPings
Nov 14 '18 at 17:13
That's what I thought :(
– Technomancer
Nov 14 '18 at 18:03
add a comment |
As the entered minute offset could also change the date,
I'd let PowerShell do the calculation
@echo off
set /p "var1=enter minutes to add: "
for /f "tokens=1*" %%A in ('
powershell -NoP -C "(Get-Date).AddMinutes(%var1%).ToString('yyyy/MM/dd HH:mm:ss')"
') do (
Set "MyDate=%%A"
set "MyTime=%%B"
)
echo SCHTASKS /change /sd %MyDate% /st %MyTime% /tn task
As the entered minute offset could also change the date,
I'd let PowerShell do the calculation
@echo off
set /p "var1=enter minutes to add: "
for /f "tokens=1*" %%A in ('
powershell -NoP -C "(Get-Date).AddMinutes(%var1%).ToString('yyyy/MM/dd HH:mm:ss')"
') do (
Set "MyDate=%%A"
set "MyTime=%%B"
)
echo SCHTASKS /change /sd %MyDate% /st %MyTime% /tn task
answered Nov 14 '18 at 13:29
LotPingsLotPings
18.8k61532
18.8k61532
Format of the date dd/MM/yyyy to work with schtasks. This solution is the one I like the most precisely because it also solves the day although I did not mention it in the question. Thank you :D
– Technomancer
Nov 14 '18 at 15:57
I do not understand why this always set 00 seconds in the tasks ... example in the echo mytimes shows 18:03:22 and in the task has put 18:03:00
– Technomancer
Nov 14 '18 at 17:05
May be an issue with schtasks itself, the helpschtasks /change /?
just mentions hours:minutes with/st
– LotPings
Nov 14 '18 at 17:13
That's what I thought :(
– Technomancer
Nov 14 '18 at 18:03
add a comment |
Format of the date dd/MM/yyyy to work with schtasks. This solution is the one I like the most precisely because it also solves the day although I did not mention it in the question. Thank you :D
– Technomancer
Nov 14 '18 at 15:57
I do not understand why this always set 00 seconds in the tasks ... example in the echo mytimes shows 18:03:22 and in the task has put 18:03:00
– Technomancer
Nov 14 '18 at 17:05
May be an issue with schtasks itself, the helpschtasks /change /?
just mentions hours:minutes with/st
– LotPings
Nov 14 '18 at 17:13
That's what I thought :(
– Technomancer
Nov 14 '18 at 18:03
Format of the date dd/MM/yyyy to work with schtasks. This solution is the one I like the most precisely because it also solves the day although I did not mention it in the question. Thank you :D
– Technomancer
Nov 14 '18 at 15:57
Format of the date dd/MM/yyyy to work with schtasks. This solution is the one I like the most precisely because it also solves the day although I did not mention it in the question. Thank you :D
– Technomancer
Nov 14 '18 at 15:57
I do not understand why this always set 00 seconds in the tasks ... example in the echo mytimes shows 18:03:22 and in the task has put 18:03:00
– Technomancer
Nov 14 '18 at 17:05
I do not understand why this always set 00 seconds in the tasks ... example in the echo mytimes shows 18:03:22 and in the task has put 18:03:00
– Technomancer
Nov 14 '18 at 17:05
May be an issue with schtasks itself, the help
schtasks /change /?
just mentions hours:minutes with /st
– LotPings
Nov 14 '18 at 17:13
May be an issue with schtasks itself, the help
schtasks /change /?
just mentions hours:minutes with /st
– LotPings
Nov 14 '18 at 17:13
That's what I thought :(
– Technomancer
Nov 14 '18 at 18:03
That's what I thought :(
– Technomancer
Nov 14 '18 at 18:03
add a comment |
I combined the methods posted at this answer in order to complete this request:
@echo OFF
echo add minutes to %time%
set/p "var1=>"
for /F "tokens=1-3 delims=:.," %%a in ("%time%") do set /A "new=(%%a*60+1%%b-100+var1)*60+1%%c-100"
set /A "ss=new%%60+100,new/=60,mm=new%%60+100,hh=new/60,hh-=hh*!(hh-24)"
set "var2=%hh%:%mm:~1%:%ss:~1%"
ECHO SCHTASKS /change /sd %date% /st %var2% /tn task
EDIT: Change to next day added
The next code also uses the method described at this answer to adjust the date part to the next day when necessary:
@echo OFF
setlocal
echo add minutes
set/p "var1=>"
for /F "tokens=2 delims==" %%a in ('wmic OS Get LocalDateTime /value') do set "dt=%%a"
set /A "D=%dt:~0,8%, MM=1%dt:~4,2%-100, newS=((1%dt:~8,2%-100)*60+1%dt:~10,2%-100+var1)*60+1%dt:~12,2%-100"
set /A "s=newS%%60+100,newS/=60,m=newS%%60+100,h=newS/60,newDD=h/24,h%%=24"
if %newDD% neq 0 (
set /A "newMM=!( 1%D:~6%-(130+(MM+MM/8)%%2+!(MM-2)*(!(%D:~0,4%%%4)-2)) ), lastMM=!(1%D:~4,2%-112), newYYYY=newMM*lastMM"
set /A "MM+=newMM*(1-lastMM*12), D+=newYYYY*(20100-1%D:~4%) + !newYYYY*newMM*(100*MM+10000-1%D:~4%) + newDD"
)
set "var2=%h%:%m:~1%:%s:~1%" & set "var3=%D:~6,2%/%D:~4,2%/%D:~0,4%"
ECHO SCHTASKS /change /sd %var3% /st %var2% /tn task
I was going to ammend my answer to fix the octal issue, but this solution works.
– Gerhard Barnard
Nov 14 '18 at 14:47
It works perfectly, I would like to give a better answer to all. Really thank.
– Technomancer
Nov 14 '18 at 15:31
IMHO it is not fair to select the best answer based on an unrequested feature...:/
See my edit.
– Aacini
Nov 15 '18 at 6:38
add a comment |
I combined the methods posted at this answer in order to complete this request:
@echo OFF
echo add minutes to %time%
set/p "var1=>"
for /F "tokens=1-3 delims=:.," %%a in ("%time%") do set /A "new=(%%a*60+1%%b-100+var1)*60+1%%c-100"
set /A "ss=new%%60+100,new/=60,mm=new%%60+100,hh=new/60,hh-=hh*!(hh-24)"
set "var2=%hh%:%mm:~1%:%ss:~1%"
ECHO SCHTASKS /change /sd %date% /st %var2% /tn task
EDIT: Change to next day added
The next code also uses the method described at this answer to adjust the date part to the next day when necessary:
@echo OFF
setlocal
echo add minutes
set/p "var1=>"
for /F "tokens=2 delims==" %%a in ('wmic OS Get LocalDateTime /value') do set "dt=%%a"
set /A "D=%dt:~0,8%, MM=1%dt:~4,2%-100, newS=((1%dt:~8,2%-100)*60+1%dt:~10,2%-100+var1)*60+1%dt:~12,2%-100"
set /A "s=newS%%60+100,newS/=60,m=newS%%60+100,h=newS/60,newDD=h/24,h%%=24"
if %newDD% neq 0 (
set /A "newMM=!( 1%D:~6%-(130+(MM+MM/8)%%2+!(MM-2)*(!(%D:~0,4%%%4)-2)) ), lastMM=!(1%D:~4,2%-112), newYYYY=newMM*lastMM"
set /A "MM+=newMM*(1-lastMM*12), D+=newYYYY*(20100-1%D:~4%) + !newYYYY*newMM*(100*MM+10000-1%D:~4%) + newDD"
)
set "var2=%h%:%m:~1%:%s:~1%" & set "var3=%D:~6,2%/%D:~4,2%/%D:~0,4%"
ECHO SCHTASKS /change /sd %var3% /st %var2% /tn task
I was going to ammend my answer to fix the octal issue, but this solution works.
– Gerhard Barnard
Nov 14 '18 at 14:47
It works perfectly, I would like to give a better answer to all. Really thank.
– Technomancer
Nov 14 '18 at 15:31
IMHO it is not fair to select the best answer based on an unrequested feature...:/
See my edit.
– Aacini
Nov 15 '18 at 6:38
add a comment |
I combined the methods posted at this answer in order to complete this request:
@echo OFF
echo add minutes to %time%
set/p "var1=>"
for /F "tokens=1-3 delims=:.," %%a in ("%time%") do set /A "new=(%%a*60+1%%b-100+var1)*60+1%%c-100"
set /A "ss=new%%60+100,new/=60,mm=new%%60+100,hh=new/60,hh-=hh*!(hh-24)"
set "var2=%hh%:%mm:~1%:%ss:~1%"
ECHO SCHTASKS /change /sd %date% /st %var2% /tn task
EDIT: Change to next day added
The next code also uses the method described at this answer to adjust the date part to the next day when necessary:
@echo OFF
setlocal
echo add minutes
set/p "var1=>"
for /F "tokens=2 delims==" %%a in ('wmic OS Get LocalDateTime /value') do set "dt=%%a"
set /A "D=%dt:~0,8%, MM=1%dt:~4,2%-100, newS=((1%dt:~8,2%-100)*60+1%dt:~10,2%-100+var1)*60+1%dt:~12,2%-100"
set /A "s=newS%%60+100,newS/=60,m=newS%%60+100,h=newS/60,newDD=h/24,h%%=24"
if %newDD% neq 0 (
set /A "newMM=!( 1%D:~6%-(130+(MM+MM/8)%%2+!(MM-2)*(!(%D:~0,4%%%4)-2)) ), lastMM=!(1%D:~4,2%-112), newYYYY=newMM*lastMM"
set /A "MM+=newMM*(1-lastMM*12), D+=newYYYY*(20100-1%D:~4%) + !newYYYY*newMM*(100*MM+10000-1%D:~4%) + newDD"
)
set "var2=%h%:%m:~1%:%s:~1%" & set "var3=%D:~6,2%/%D:~4,2%/%D:~0,4%"
ECHO SCHTASKS /change /sd %var3% /st %var2% /tn task
I combined the methods posted at this answer in order to complete this request:
@echo OFF
echo add minutes to %time%
set/p "var1=>"
for /F "tokens=1-3 delims=:.," %%a in ("%time%") do set /A "new=(%%a*60+1%%b-100+var1)*60+1%%c-100"
set /A "ss=new%%60+100,new/=60,mm=new%%60+100,hh=new/60,hh-=hh*!(hh-24)"
set "var2=%hh%:%mm:~1%:%ss:~1%"
ECHO SCHTASKS /change /sd %date% /st %var2% /tn task
EDIT: Change to next day added
The next code also uses the method described at this answer to adjust the date part to the next day when necessary:
@echo OFF
setlocal
echo add minutes
set/p "var1=>"
for /F "tokens=2 delims==" %%a in ('wmic OS Get LocalDateTime /value') do set "dt=%%a"
set /A "D=%dt:~0,8%, MM=1%dt:~4,2%-100, newS=((1%dt:~8,2%-100)*60+1%dt:~10,2%-100+var1)*60+1%dt:~12,2%-100"
set /A "s=newS%%60+100,newS/=60,m=newS%%60+100,h=newS/60,newDD=h/24,h%%=24"
if %newDD% neq 0 (
set /A "newMM=!( 1%D:~6%-(130+(MM+MM/8)%%2+!(MM-2)*(!(%D:~0,4%%%4)-2)) ), lastMM=!(1%D:~4,2%-112), newYYYY=newMM*lastMM"
set /A "MM+=newMM*(1-lastMM*12), D+=newYYYY*(20100-1%D:~4%) + !newYYYY*newMM*(100*MM+10000-1%D:~4%) + newDD"
)
set "var2=%h%:%m:~1%:%s:~1%" & set "var3=%D:~6,2%/%D:~4,2%/%D:~0,4%"
ECHO SCHTASKS /change /sd %var3% /st %var2% /tn task
edited Nov 15 '18 at 6:36
answered Nov 14 '18 at 14:16
AaciniAacini
51.4k75274
51.4k75274
I was going to ammend my answer to fix the octal issue, but this solution works.
– Gerhard Barnard
Nov 14 '18 at 14:47
It works perfectly, I would like to give a better answer to all. Really thank.
– Technomancer
Nov 14 '18 at 15:31
IMHO it is not fair to select the best answer based on an unrequested feature...:/
See my edit.
– Aacini
Nov 15 '18 at 6:38
add a comment |
I was going to ammend my answer to fix the octal issue, but this solution works.
– Gerhard Barnard
Nov 14 '18 at 14:47
It works perfectly, I would like to give a better answer to all. Really thank.
– Technomancer
Nov 14 '18 at 15:31
IMHO it is not fair to select the best answer based on an unrequested feature...:/
See my edit.
– Aacini
Nov 15 '18 at 6:38
I was going to ammend my answer to fix the octal issue, but this solution works.
– Gerhard Barnard
Nov 14 '18 at 14:47
I was going to ammend my answer to fix the octal issue, but this solution works.
– Gerhard Barnard
Nov 14 '18 at 14:47
It works perfectly, I would like to give a better answer to all. Really thank.
– Technomancer
Nov 14 '18 at 15:31
It works perfectly, I would like to give a better answer to all. Really thank.
– Technomancer
Nov 14 '18 at 15:31
IMHO it is not fair to select the best answer based on an unrequested feature...
:/
See my edit.– Aacini
Nov 15 '18 at 6:38
IMHO it is not fair to select the best answer based on an unrequested feature...
:/
See my edit.– Aacini
Nov 15 '18 at 6:38
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53298208%2fadd-minutes-whole-number-in-time-to-batch-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Use PowerShell, even from your batch file if necessary. It has methods of adding/subtracting from the time.
– Compo
Nov 14 '18 at 11:15