I have scripted ShortDate.bat to insure that a short date contains a 4 digit year, two digit month, and 2 digit day.

The syntax for using ShortDate.bat is:

\[Call\] ShortDate iDT iDS sDT YY MM DD

Where:

                              iDT is your short date order, retrieved from the iDate Value Name.                              iDS is your date separator, retrieved from the sDate Value Name.                              sDT is the name of the environment variable that contains the short date, which will be 'fixed'.                              YY  is a call directed environment variable that will contain the 4 digit year.                              MM  is a call directed environment variable that will contain the 2 digit month.                              DD  is a call directed environment variable that will contain the 4 digit day.
ShortDate.bat contains:
                              @echo off                              if \{%6\}==\{\} @echo ShortDate iDT iDS sDT YY MM DD&goto :EOF                              if \{%1\} GTR \{2\} @echo ShortDate iDT sDT - iDT out of range - %1&goto :EOF                              if \{%1\} LSS \{0\} @echo ShortDate iDT sDT - iDT out of range - %1&goto :EOF                              setlocal                              set iDT=%1                              set iDS=%2                              call set sDT=%%%3%%                              for /f "tokens=1-3 delims=%iDS%" %%a in ('@echo %sDT%') do (                               set d1=20%%a                               set d2=20%%b                               set d3=20%%c                              )                              goto iDT%iDT%                              :iDT0                              set YY=%d3:~-4%                              set MM=%d1:~-2%                              set DD=%d2:~-2%                              set sDT=%MM%%iDS%%DD%%iDS%%YY%                              goto finish                              :iDT1                              set YY=%d3:~-4%                              set MM=%d2:~-2%                              set DD=%d1:~-2%                              set sDT=%DD%%iDS%%MM%%iDS%%YY%                              goto finish                              :iDT2                              set YY=%d1:~-4%                              set MM=%d2:~-2%                              set DD=%d3:~-2%                              set sDT=%YY%%iDS%%MM%%iDS%%DD%                              :finish                              endlocal&set %3=%sDT%&set %4=%YY%&set %5=%MM%&set %6=%DD%