Created
January 14, 2016 14:34
-
-
Save KenDB3/2ea86c9d82c0d14aacb1 to your computer and use it in GitHub Desktop.
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=1-4 delims=/ " %%i in ('date /t') do ( | |
set WD=%%i | |
set D=%%j | |
set M=%%k | |
set Y=%%l | |
) | |
for /F "tokens=1-4 delims=: " %%i in ('time /t') do ( | |
set H=%%i | |
set Hr=%%i | |
set Mn=%%j | |
set AP=%%k | |
) | |
set yearxx=%DATE:~12,2% | |
if "%AP%"=="PM" set /A H=%H%+12 | |
REM This one looks like: "Fri 01/01/2016 - 23:59" | |
echo %WD% %D%/%M%/%Y% - %H%:%Mn% | |
echo or... | |
REM This one looks like: "Fri 01/01/16 - 11:59 PM" | |
echo %WD% %D%/%M%/%yearxx% - %Hr%:%Mn% %AP% | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment