- ::0
- @echo off
- for /f "eol=Etokens=5-7delims=. " %%i in ('echo.^|command /c date') do set /ay=%%i,m=1%%j-100,d=1%%k-100
- set /a "m=(m+9)%%12+4,y-=m/14,JD=1461*y/4+153*M/5+d,w=jd%%7,jdx=jd+15"
- set /p flag=<%0
- set flag=%flag::=%
- if %w% equ 2 (
- if %flag% equ 0 (
- set /a "JD-=1,flag=1
- ) else set /a "JD+=1,flag=0"
- set/a "ys=(JD*4-489)/1461,d=jd-1461*y/4,m=d*100/3061,d-=153*m/5,y+=m/14,m-=m/14*12+1"
- )
- if defined ys (
- echo %ys%.%m%.%d%|command /c date
- for /f "delims=" %%i in ('type %0') do (
- set "str=%%i"
- setlocal enabledelayedexpansion
- if defined s (
- >>%0 echo;!str!
- ) else >%0 echo;::%flag%
- for %%j in (s) do endlocal&set s=0
- )
- )
- pause
复制代码
|