Created
July 23, 2012 07:03
-
-
Save shunwen/3162357 to your computer and use it in GitHub Desktop.
Chop %date% and %time% into useful tokens
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
REM get date from MM/DD/YYYY | |
SET YEAR=%DATE:~6,4% | |
SET MONTH=%DATE:~0,2% | |
SET DAY=%DATE:~3,2% | |
SET DATENOW=%YEAR%%MONTH%%DAY% | |
REM get time from hh:mm:ss.ss | |
SET hh=%TIME:~0,2% | |
IF %hh% LSS 10 SET hh=0%hh:~1,1% | |
SET mm=%TIME:~3,2% | |
SET ss=%TIME:~6,2% | |
SET TIMENOW=%hh%%mm%%ss% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment