Here is a piece of code I got from some site on the internet. (The top part only. The bottom part I added.) Don't ask me what site I got it from because I can't remember. I went to so many.
This can be executed from a batch file in Win NT.
echo. | date | FIND "(mm" > NUL
if errorlevel 1 (call :ParseDate DD MM) else (call :ParseDate MM DD)
for /f "tokens=1-4 delims=/.- " %%a in ('date /t') do (