this should work in spanish but if there is an option to put the month in three letter version then change jan feb mar, etc to the spanish version in the script below:
@echo off&SetLocal EnableDelayedExpansion&goto :start
:GetDate [EnVar]
echo.GetDate [EnVar] Sets date into environment variable, EnVar as: dd-mm-aaaa
echo.Usage: GetDate dma^&set ymd=%%errorlevel%%, ^(use %% rather than ^^! in command line)
echo.Usage: GetDate dma^&set ymd=^^!errorlevel^^!, ^(use ^^! rather than %% in script^)
echo.If no argument passed it echo's the date in dd-mm-aaaa format
echo.Returns aaaammdd in errorlevel regardless if Envar is passed as argument or not
echo.Works on NT/2K/XP/Vista/Win7 machines independent of most regional date settings
EndLocal&exit /b
:start
set p1=%~1&if /i "!p1!" equ "/?" goto :GetDate
if /i "%date%A" lss "A" (set toks=1-3) else (set toks=2-4)
for /f "skip=1 tokens=2-4 delims=(-)" %%a in ('date^<nul') do (
for /f "tokens=%toks% delims=.-/ " %%d in ('date/t') do (
set %%a=%%d&set %%b=%%e&set "%%c=%%f"
)
)
if /i "%mm:~0,1%" gtr "9" call :month_convert mm
if /i 1%mm% lss 20 set "mm=0%mm%"
if /i %aa% lss 100 set "aa=20%aa%"
if defined p1 (
Endlocal
call set "%~1=%dd%-%mm%-%aa%"&exit /b %yy%%mm%%aa%
)
EndLocal&echo.%dd%-%mm%-%aa%&exit /b %yy%%mm%%dd%
:month_convert
set "months=Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"
call set "month=%%%~1%%"
set/a mnum=0
for %%m in (%months%) do set/a mnum+=1&if /i %month% equ %%m call set "%~1=!mnum!"&exit /b