Split %date% in a batch file regardless of Regional Settings
Four years have passed, but this question doesn’t get old, and I think now there’s a slightly better answer than using wmic (on win7 onwards). for /F “tokens=1,2,3 delims=_” %%i in (‘PowerShell -Command “& {Get-Date -format “MM_dd_yyyy”}”‘) do ( set MONTH=%%i set DAY=%%j set YEAR=%%k ) echo %MONTH% %DAY% %YEAR% With powershell Get-Date you can … Read more