Created
December 30, 2013 15:37
-
-
Save CarlRevell/8183564 to your computer and use it in GitHub Desktop.
Useful DOS .cmd/.bat file date and time snippets.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET YEAR=%DATE:~6,4% | |
SET MONTH=%DATE:~3,2% | |
SET DAY=%DATE:~0,2% | |
SET HOUR=%TIME:~0,2% | |
IF /I %HOUR% LEQ 9 SET HOUR=0%HOUR:~1,1% | |
SET MINUTE=%TIME:~3,2% | |
SET SECOND=%TIME:~6,2% | |
SET ISODATE=%YEAR%-%MONTH%-%DAY%_%HOUR%-%MINUTE%-%SECOND% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment