Created
December 16, 2013 19:55
-
-
Save jtbrough/7993271 to your computer and use it in GitHub Desktop.
Generate Windows Batch datetime stamp in yyyy-mm-dd_hhmmss (24hr) format.
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
@echo off | |
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set file_date=%%c-%%a-%%b) | |
For /f "tokens=1-3 delims=:." %%a in ("%TIME%") do (set file_time=%%a%%b%%c) | |
echo %file_date%_%file_time% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment