Setting day,month and year variables in Windows batch

@echo off&SETLOCAL
FOR /f "tokens=1-4 delims=/-. " %%G IN ('date /t') DO (call :FIXDATE %%G %%H %%I %%J)
goto :SETDATE
:FIXDATE
if "%1:~0,1%" GTR "9" shift
FOR /f "skip=1 tokens=2-4 delims=(-)" %%G IN ('echo.^|date') DO (
    set %%G=%1&set %%H=%2&set %%I=%3)
goto :eof
:SETDATE
ENDLOCAL&SET mm=%mm%&SET dd=%dd%&SET yy=%yy%

Comments

Popular posts from this blog

City Code Table for Casio SGW300HD-1AV Watch

How to force only 4G or LTE network connection for Samsung Galaxy Note 4

Mounting NFS share directory from D-link DNS 320L on Ubuntu 12.04 LTS