2GORA2
Заработало,
Хотя мне больше понравилась реализация
[more=:: DateTime using WSH]
:: DateTime using WSH
:: datetime.bat V4
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: This uses Windows Scripting Host to set variables
:: to the current date/time/day/day_number
:: for Win9x/ME/NT/W2K/XP etc
:: Thanks go to Todd Vargo for his scripting
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
set TmpFile="%temp%.\tmp.vbs"
echo> %TmpFile% n=Now
echo>>%TmpFile% With WScript
echo>>%TmpFile% .Echo "set year=" + CStr(Year(n))
echo>>%TmpFile% .Echo "set yr=" + Right(Year(n),2)
echo>>%TmpFile% .Echo "set month="+ Right(100+Month(n),2)
echo>>%TmpFile% .Echo "set day=" + Right(100+Day(n),2)
echo>>%TmpFile% .Echo "set hour=" + Right(100+Hour(n),2)
echo>>%TmpFile% .Echo "set min=" + Right(100+Minute(n),2)
echo>>%TmpFile% .Echo "set sec=" + Right(100+Second(n),2)
echo>>%TmpFile% .Echo "set dow=" + WeekDayName(Weekday(n),1)
echo>>%TmpFile% .Echo "set dow2=" + WeekDayName(Weekday(n))
echo>>%TmpFile% .Echo "set iso=" + CStr(1 + Int(n-2) mod 7)
echo>>%TmpFile% .Echo "set iso2=" + CStr(Weekday(n,2))
echo>>%TmpFile% End With
cscript //nologo "%temp%.\tmp.vbs" > "%temp%.\tmp.bat"
call "%temp%.\tmp.bat"
del "%temp%.\tmp.bat"
del %TmpFile%
set TmpFile=
set stamp=%year%-%month%-%day%_%hour%.%min%.%sec%
echo The year (YYyy) is "%year%"
echo The year (yy) is "%yr%"
echo The month is "%month%"
echo The day (%dow%) is "%day%"
echo The full weekday name is "%dow2%"
echo.
echo ISO 8601 Day-Of-Week number is "%iso%"
echo.
echo The hour is "%hour%"
echo The minute is "%min%"
echo The second is "%sec%"
echo.
echo The date and time stamp is "%stamp%"
echo.
echo time (hhmmss) (%hour%%min%%sec%)
echo.
echo date A (yyyymmdd) (%year%%month%%day%)
echo date B (mmddyyyy) (%month%%day%%year%)
echo date C (ddmmyyyy) (%day%%month%%year%)
echo.
echo date D [yymmdd] [%yr%%month%%day%]
echo date E [mmddyy] [%month%%day%%yr%]
echo date F [ddmmyy] [%day%%month%%yr%]
:: datetime.bat
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
[/more]
Цитата: с названием месяца даже удобней
Это кому как, на вкус и цвет фломастеры разные...