Search found 2 matches
- 18 Sep 2012 09:48
- Forum: DOS Batch Forum
- Topic: batch command time help
- Replies: 3
- Views: 3030
Re: batch command time help
So far I have did the following: set HH=%TIME:~0,2% set MM=%TIME:~3,2% set SS=%TIME:~6,2% ECHO %HH%:%MM%:%SS% ECHO %MM% set /a SECS_IN_MINS=%MM% * 60 ECHO %SECS_IN_MINS% ECHO %SECS_IN_HOURS% set /a SECS_IN_HOURS=%HH% * 3600 ECHO %SECS_IN_HOURS% set /a TOTAL_SECS=%SECS_IN_HOURS% + %SECS_IN_MINS% + %S...
- 18 Sep 2012 08:18
- Forum: DOS Batch Forum
- Topic: batch command time help
- Replies: 3
- Views: 3030
batch command time help
I need to do the following in a batch file:
Get the current date and time and format it like so:
YYYY-MM-DD:HH:MM:SS
e.g. 2012-08-28:13:00:00
ANd then I also need to subtract a number of seconds from this e.g. 30 seconds
How do I do this in batch file commands.
Thanks
Get the current date and time and format it like so:
YYYY-MM-DD:HH:MM:SS
e.g. 2012-08-28:13:00:00
ANd then I also need to subtract a number of seconds from this e.g. 30 seconds
How do I do this in batch file commands.
Thanks