|
s11ss
银牌会员
    
积分 2098
发帖 566
注册 2007-9-11
状态 离线
|
  『楼 主』:
[原创]********简单万年历********
使用 LLM 解释/回答一下
@echo off
setlocal enabledelayedexpansion
::::::::简单万年历 {s11ss 2007-9-29}::::::::
::原理:求出某月1日是星期几,由此得出其它天对应于星期几,最后分行显示各天。
echo Please input a year and a month,like 2007-9:
echo.
set/p str=
for /f "delims=- tokens=1*" %%a in ('echo %str%') do (
set/a year=%%a
set/a month=%%b
if %%b leq 2 (set/a year-=1 && set/a month+=12)
set y=!year:~-2!
set is0=!y:~0,1!
if !is0! equ 0 set y=!y:~1,1!
set c=!year:~0,-2!
set m=!month!
set d=1
if %%b leq 2 (set/a year+=1 && set/a month-=12)
)
set/a w=(!y!+!y!/4+%c%/4-2*%c%+26*(%m%+1)/10+%d%-1)
::上面这个源于蔡勒公式,是算出1号是星期几的关键。
set/a ?=!w!%%7
if !?! lss 0 set/a ?+=7
set/a r4=!year!%%4,r100=!year!%%100,r400=!year!%%400
set/a feb=28
if !r4! equ 0 (if not !r100! equ 0 set/a feb=29)
if !r400! equ 0 set/a feb=29
set/a mseq=1
for %%a in (31,!feb!,31,30,31,30,31,31,30,31,30,31) do (
if !mseq! equ !month! (set/a day=%%a && goto :e)
set/a mseq+=1
)
:e
set s1= 1
for /l %%a in (1,1,!?!) do set s1= !s1!
set/a row=1
set x=!s1!
for /l %%a in (2,1,!day!) do (
if %%a lss 10 (set dseq= %%a) else (set dseq=%%a)
set/a ?+=1
if !?! equ 7 (
set/a ?=0
set s!row!=!x!
set/a row+=1
set x=!dseq!
) else (
set x=!x! !dseq!
)
)
set s!row!=!x!
echo 日 一 二 三 四 五 六
for /l %%a in (1,1,!row!) do echo !s%%a!
echo.
echo Press Any Key To Exit...
pause>nul
goto :eof
蔡勒公式
蔡勒(Zeller)公式:是一个计算星期的公式。
随便给一个日期,就能用这个公式推算出是星期几。
蔡勒公式如下:
w=y++-2c++d-1
公式中的符号含义如下:
w:星期; w对7取模得:0-星期日,1-星期一,2-星期二,3-星期三,4-星期四,5-星期五,6-星期六
c:世纪(前两位数)
y:年(后两位数)
m:月(m大于等于3,小于等于14,即在蔡勒公式中,某年的1、2月要看作上一年的13、14月来计算,比如2003年1月1日要看作2002年的13月1日来计算)
d:日
代表取整,即只要整数部分。
下面以中华人民共和国成立100周年纪念日那天(2049年10月1日)来计算是星期几,过程如下:
w=y++-2c++d-1
=49++-2×20++1-1
=49++5-40+
=49+12+5-40+28
=54 (除以7余5)
即2049年10月1日(100周年国庆)是星期五。
再比如计算2006年4月4日,过程如下:
w=y++-2c++d-1
=6++-2*20++4-1
=-12 (除以7余2,注意对负数的取模运算!)
不过,以上的公式都只适合于1582年(我国明朝万历十年)10月15日之后的情形。罗马教皇格里高利十三世在1582年组织了一批天文学家,根据哥白尼日心说计算出来的数据,对儒略历作了修改。将1582年10月5日到14日之间的10天宣布撤销,继10月4日之后为10月15日。
后来人们将这一新的历法称为“格里高利历”,也就是今天世界上所通用的历法,简称格里历或公历。
@echo off
setlocal enabledelayedexpansion
::::::::Simple perpetual calendar {s11ss 2007-9-29}::::::::
::Principle: Find out what day of the week the first day of a certain month is, from which we can get what day of the week other days correspond to, and finally display each day by rows.
echo Please input a year and a month,like 2007-9:
echo.
set/p str=
for /f "delims=- tokens=1*" %%a in ('echo %str%') do (
set/a year=%%a
set/a month=%%b
if %%b leq 2 (set/a year-=1 && set/a month+=12)
set y=!year:~-2!
set is0=!y:~0,1!
if !is0! equ 0 set y=!y:~1,1!
set c=!year:~0,-2!
set m=!month!
set d=1
if %%b leq 2 (set/a year+=1 && set/a month-=12)
)
set/a w=(!y!+!y!/4+%c%/4-2*%c%+26*(%m%+1)/10+%d%-1)
::The above comes from Zeller's formula, which is the key to finding out what day of the week the 1st is.
set/a ?=!w!%%7
if !?! lss 0 set/a ?+=7
set/a r4=!year!%%4,r100=!year!%%100,r400=!year!%%400
set/a feb=28
if !r4! equ 0 (if not !r100! equ 0 set/a feb=29)
if !r400! equ 0 set/a feb=29
set/a mseq=1
for %%a in (31,!feb!,31,30,31,30,31,31,30,31,30,31) do (
if !mseq! equ !month! (set/a day=%%a && goto :e)
set/a mseq+=1
)
:e
set s1= 1
for /l %%a in (1,1,!?!) do set s1= !s1!
set/a row=1
set x=!s1!
for /l %%a in (2,1,!day!) do (
if %%a lss 10 (set dseq= %%a) else (set dseq=%%a)
set/a ?+=1
if !?! equ 7 (
set/a ?=0
set s!row!=!x!
set/a row+=1
set x=!dseq!
) else (
set x=!x! !dseq!
)
)
set s!row!=!x!
echo Sun Mon Tue Wed Thu Fri Sat
for /l %%a in (1,1,!row!) do echo !s%%a!
echo.
echo Press Any Key To Exit...
pause>nul
goto :eof
Zeller's Formula
Zeller's (Zeller) formula: is a formula for calculating the day of the week.
For any given date, you can use this formula to calculate what day of the week it is.
The Zeller formula is as follows:
w=y++-2c++d-1
The meanings of the symbols in the formula are as follows:
w: Day of the week; w modulo 7 gives: 0-Sunday, 1-Monday, 2-Tuesday, 3-Wednesday, 4-Thursday, 5-Friday, 6-Saturday
c: Century (first two digits)
y: Year (last two digits)
m: Month (m is greater than or equal to 3 and less than or equal to 14, that is, in Zeller's formula, January and February of a certain year should be regarded as the 13th and 14th months of the previous year. For example, January 1, 2003 should be regarded as January 1, 2002)
d: Day
represents taking the integer part, that is, only the integer part.
The following takes the 100th anniversary of the founding of the People's Republic of China (October 1, 2049) to calculate what day of the week it is. The process is as follows:
w=y++-2c++d-1
=49++-2×20++1-1
=49++5-40+
=49+12+5-40+28
=54 (remainder 5 when divided by 7)
That is, October 1, 2049 (100th anniversary of National Day) is Friday.
Another example: calculate April 4, 2006. The process is as follows:
w=y++-2c++d-1
=6++-2*20++4-1
=-12 (remainder 2 when divided by 7, pay attention to the modulo operation for negative numbers!)
However, the above formula is only suitable for the situation after October 15, 1582 (the 10th year of Wanli in the Ming Dynasty in China). Pope Gregory XIII of Rome organized a group of astronomers in 1582 to calculate data based on Copernicus' heliocentric theory and modified the Julian calendar. The 10 days between October 5 and 14, 1582 were declared void, and October 15 followed October 4.
Later, people called this new calendar the "Gregorian calendar", which is the calendar commonly used in the world today, referred to as the Gregorian calendar or the Gregorian calendar.
|
|
2007-9-29 16:01 |
|
|
knoppix7
银牌会员
    
积分 1287
发帖 634
注册 2007-5-2 来自 cmd.exe
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
我也写过一个~~~~~~~~~~~~~
@echo off
setlocal enabledelayedexpansion
:{
://处理月数
set Y=%date:~0,4%
set M=%date:~5,2%
set D=%date:~8,2%
if %M:~0,1%==0 set M=%M:~1,1%
if %D:~0,1%==0 set D=%D:~1,1%
FOR %%i IN (4 400) DO (
set /a T1=%y%%%%%i
if !T1!==0 (set runnian=1) ELSE set runnian=0
)
call :checkmouth %runnian%
set T1=%Y:~0,2%
set T2=%Y:~2,2%
if %T2:~0,1%==0 set T2=%T2:~1,1%
set /a T1=%T1%%%4
set /a T1=T1/-2+5
set /a T2=((%T2%-%t2%%%4)/4+%T2%)%%7
call :yueyushu
set /a T4=(%T1%+%T2%+%T3%+1)%%7
rem T4=星期数,0=>日 1=>一 ....
set T1=&set T2=&set T3=&set Y=
:}
:{
://显示准备
call :setdateend %M%
set /a dateend=%dateend%+%T4%-1
set T1=1
for /L %%i IN (0,1,38) DO (
if %%i GEQ %T4% IF %%i LEQ %dateend% (
if !T1! LEQ 9 (set W%%i= !T1! ) ELSE set W%%i=!T1!
if !T1! EQU %D% set W%%i=!T1!*
call set T5=%%js9!T1!%%
if NOT "!T5!"=="" (
if !T1! LEQ 9 (set W%%i= !T1!$) ELSE set W%%i=!T1!$
if !T1! EQU %D% (
if !T1! LEQ 9 (set W%%i= !T1!#) ELSE set W%%i=!T1!#
)
)
set /a T1=!T1!+1
)
if %%i LSS %T4% set "W%%i= "
if %%i GTR %dateend% set "W%%i= "
)
set T1=
echo 今天是:%date%
echo 日 一 二 三 四 五 六
echo %W0% %W1% %W2% %W3% %W4% %W5% %W6%
echo %W7% %W8% %W9% %W10% %W11% %W12% %W13%
echo %W14% %W15% %W16% %W17% %W18% %W19% %W20%
echo %W21% %W22% %W23% %W24% %W25% %W26% %W27%
echo %W28% %W29% %W30% %W31% %W32% %W33% %W34%
echo %W35% %W36% %W37% %W38%
GOTO :EOF
:}
:{
://子区块部分
:setdateend
for %%i IN (1 3 5 7 8 10 12) DO (
if %1==%%i (set dateend=31) ELSE set dateend=30
)
if %1==2 (
If %runnian%==1 (set dateend=29) ELSE set dateend=28
)
GOTO :EOF
:yueyushu
set T3=!%m%y!
goto :EOF
:checkmouth
if %1==0 (
set 1y=1
set 2y=4
) ELSE (
set 1y=0
set 2y=3
)
set 3y=4
set 4y=0
set 5y=2
set 6y=5
set 7y=0
set 8y=3
set 9y=6
set 10y=1
set 11y=4
set 12y=8
GOTO :EOF
:}
I also wrote one ~~~~~~~~~~~~~
@echo off
setlocal enabledelayedexpansion
:{
://Process months
set Y=%date:~0,4%
set M=%date:~5,2%
set D=%date:~8,2%
if %M:~0,1%==0 set M=%M:~1,1%
if %D:~0,1%==0 set D=%D:~1,1%
FOR %%i IN (4 400) DO (
set /a T1=%y%%%%%i
if !T1!==0 (set runnian=1) ELSE set runnian=0
)
call :checkmouth %runnian%
set T1=%Y:~0,2%
set T2=%Y:~2,2%
if %T2:~0,1%==0 set T2=%T2:~1,1%
set /a T1=%T1%%%4
set /a T1=T1/-2+5
set /a T2=((%T2%-%t2%%%4)/4+%T2%)%%7
call :yueyushu
set /a T4=(%T1%+%T2%+%T3%+1)%%7
rem T4=Week number, 0=>Sunday 1=>Monday ....
set T1=&set T2=&set T3=&set Y=
:}
:{
://Display preparation
call :setdateend %M%
set /a dateend=%dateend%+%T4%-1
set T1=1
for /L %%i IN (0,1,38) DO (
if %%i GEQ %T4% IF %%i LEQ %dateend% (
if !T1! LEQ 9 (set W%%i= !T1! ) ELSE set W%%i=!T1!
if !T1! EQU %D% set W%%i=!T1!*
call set T5=%%js9!T1!%%
if NOT "!T5!"=="" (
if !T1! LEQ 9 (set W%%i= !T1!$) ELSE set W%%i=!T1!$
if !T1! EQU %D% (
if !T1! LEQ 9 (set W%%i= !T1!#) ELSE set W%%i=!T1!#
)
)
set /a T1=!T1!+1
)
if %%i LSS %T4% set "W%%i= "
if %%i GTR %dateend% set "W%%i= "
)
set T1=
echo Today is: %date%
echo Sun Mon Tue Wed Thu Fri Sat
echo %W0% %W1% %W2% %W3% %W4% %W5% %W6%
echo %W7% %W8% %W9% %W10% %W11% %W12% %W13%
echo %W14% %W15% %W16% %W17% %W18% %W19% %W20%
echo %W21% %W22% %W23% %W24% %W25% %W26% %W27%
echo %W28% %W29% %W30% %W31% %W32% %W33% %W34%
echo %W35% %W36% %W37% %W38%
GOTO :EOF
:}
:{
://Sub-block part
:setdateend
for %%i IN (1 3 5 7 8 10 12) DO (
if %1==%%i (set dateend=31) ELSE set dateend=30
)
if %1==2 (
If %runnian%==1 (set dateend=29) ELSE set dateend=28
)
GOTO :EOF
:yueyushu
set T3=!%m%y!
goto :EOF
:checkmouth
if %1==0 (
set 1y=1
set 2y=4
) ELSE (
set 1y=0
set 2y=3
)
set 3y=4
set 4y=0
set 5y=2
set 6y=5
set 7y=0
set 8y=3
set 9y=6
set 10y=1
set 11y=4
set 12y=8
GOTO :EOF
:}
|
|
2007-9-29 17:30 |
|
|
wudixin96
银牌会员
    
积分 1928
发帖 931
注册 2007-1-6
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
高手对决啊,激出火花
A showdown between experts, sparking intense interaction
|
|
2007-9-29 17:32 |
|
|
knoppix7
银牌会员
    
积分 1287
发帖 634
注册 2007-5-2 来自 cmd.exe
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
可惜他的方法比我的简单多了~~
It's a pity that his method is much simpler than mine~~
|
|
2007-9-29 17:55 |
|
|
s11ss
银牌会员
    
积分 2098
发帖 566
注册 2007-9-11
状态 离线
|
   『第 5 楼』:
使用 LLM 解释/回答一下
Originally posted by knoppix7 at 2007-9-29 05:55 PM:
可惜他的方法比我的简单多了~~
knoppix7,你的闰年判断好像有问题啊.
你的意思是能被400整除的才是闰年?
可以用2004-2-29来测试一下.........2004显然是闰年
Originally posted by knoppix7 at 2007-9-29 05:55 PM:
It's a pity that his method is much simpler than mine~~
knoppix7, there seems to be a problem with your leap year judgment.
Do you mean that only those divisible by 400 are leap years?
You can test it with 2004-2-29.........2004 is obviously a leap year
|
|
2007-9-29 23:01 |
|
|
lipu721
新手上路

积分 4
发帖 2
注册 2007-9-29
状态 离线
|
|
2007-9-29 23:50 |
|
|
lipu721
新手上路

积分 4
发帖 2
注册 2007-9-29
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
看了就头晕,太多了。我晕
It's dizzying just looking at it, there are too many. I'm dizzy
|
|
2007-9-29 23:50 |
|
|
knoppix7
银牌会员
    
积分 1287
发帖 634
注册 2007-5-2 来自 cmd.exe
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
被4或400整除才是.
明白了.计算程序错了...
要把
FOR %%i IN (4 400) DO (
set /a T1=%y%%%%%i
if !T1!==0 (set runnian=1) ELSE set runnian=0
)
修改成
set runnian=0
FOR %%i IN (4 400) DO (
set /a T1=%y%%%%%i
if !T1!==0 (set runnian=1)
)
Last edited by knoppix7 on 2007-9-30 at 04:45 PM ]
Only divisible by 4 or 400.
Got it. The calculation program was wrong...
Need to change
FOR %%i IN (4 400) DO (
set /a T1=%y%%%%%i
if !T1!==0 (set runnian=1) ELSE set runnian=0
)
to
set runnian=0
FOR %%i IN (4 400) DO (
set /a T1=%y%%%%%i
if !T1!==0 (set runnian=1)
)
Last edited by knoppix7 on 2007-9-30 at 04:45 PM ]
|
|
2007-9-30 12:36 |
|
|
knoppix7
银牌会员
    
积分 1287
发帖 634
注册 2007-5-2 来自 cmd.exe
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
作为DEBUG的回报。加4点吧.
As a return for DEBUG. Add 4 points.
|
|
2007-9-30 16:46 |
|
|
s11ss
银牌会员
    
积分 2098
发帖 566
注册 2007-9-11
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
knoppix7,
你判断闰年的算法有问题.对于闰年的判断我过去也一直是一头雾水。
能被4或400整除的是闰年,这句话就相当于说能被4整除的是闰年,因为一个数能被400整除是这个数能被4整除的充分条件。
就好比说:
大眼睛的或大眼睛长头发的女人是美女。其实就是说大眼睛的女人是美女。
正确的算法应该是:
能被4整除,且不能被100整除的是闰年;或者能被400整除的是闰年。
比如2100年按你的算法是闰年,但其实不是,因为它上面两个条件都不满足。
但其实能被3200整除的不是闰年,不过这离现在太远了。一般就是按上面的算法判断闰年的。
关于闰年的判断早在几年前学C语言的时候我就没弄明白,最近写这个万年历的时候才总算彻底搞懂了。
knoppix7,
There is a problem with the algorithm you used to judge leap years. I used to be completely confused about judging leap years.
The statement "A year divisible by 4 or 400 is a leap year" is equivalent to saying that a year divisible by 4 is a leap year, because a number divisible by 400 is a sufficient condition for the number to be divisible by 4.
It's like saying: A woman with big eyes or a woman with big eyes and long hair is a beauty. Actually, it means that a woman with big eyes is a beauty.
The correct algorithm should be: A year divisible by 4 but not by 100 is a leap year; or a year divisible by 400 is a leap year.
For example, the year 2100 would be a leap year according to your algorithm, but actually it is not because it does not satisfy either of the above two conditions.
But actually, a year divisible by 3200 is not a leap year, but that's too far from now. Generally, the above algorithm is used to judge leap years.
I didn't understand the judgment of leap years when I studied C language a few years ago. I finally fully understood it when I wrote this perpetual calendar recently.
|
|
2007-9-30 17:23 |
|
|
slore
铂金会员
      
积分 5212
发帖 2478
注册 2007-2-8
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
其实能被3200整除的不是闰年……这个说法太……不要说的让人产生反面是闰年的说法……
能被4整除,且不能被100整除的是闰年;或者能被400整除的是闰年。
这个是对的。
原因:
阳历究竟哪一年算是闰年,只要做一次简单的计算就知道,用4去除阳历的年份,除尽的就是闰年,象1964年、1968年等等都是闰年,这几年的二月都有29天。
又因为阳历一年的确实天数应该是365天5小时48分46秒,比常年365天多出5小时48分46秒,四年一共只多出23小时15分4秒。每4年一闰加一天的话,又多加了44分56秒,400年差不多就会多加出3天来,所以,每400年得扣去3天才行,于是,又定了一一条补充规定:每逢阳历年份是整白的那一年,比如公元l800年、1900年、2000年等,能被400除尽的才算是闰年。这样公元1800年和1900年尽管能被4除尽,但是不能被400除尽,所以不算是闰年,而公元2000年才是闰年,它的二月才有29天。有了这样一条补充规定,每四百年就可以从中扣去那多加出来的3天了。虽然这样调整以后,也还会有微小的误差,但要经过3000年后才会差一天,我们日常应用就算很准确了。
Actually, the statement that "what is divisible by 3200 is not a leap year" is too... Don't make it lead to the idea that the opposite is a leap year...
A year divisible by 4 but not by 100 is a leap year; or a year divisible by 400 is a leap year. This is correct.
Reason:
To determine which year in the solar calendar is a leap year, you just need to do a simple calculation. Divide the year of the solar calendar by 4. If it is divisible, it is a leap year. For example, 1964, 1968, etc., are all leap years, and February of these years has 29 days.
Also, because the actual number of days in a solar year is 365 days 5 hours 48 minutes 46 seconds, which is 5 hours 48 minutes 46 seconds more than the common year of 365 days. Over four years, it only adds up to 23 hours 15 minutes 4 seconds. If we add one day every 4 years for a leap year, we add an extra 44 minutes 56 seconds. In about 400 years, it will add about 3 days. So, we have set an additional rule: For years that are full centuries in the solar calendar, such as AD 1800, 1900, 2000, etc., only those divisible by 400 are considered leap years. Therefore, although AD 1800 and 1900 are divisible by 4, they are not divisible by 400, so they are not considered leap years, while AD 2000 is a leap year, and February of it has 29 days. With this additional rule, we can subtract those 3 extra days over 400 years. Although there will still be a slight error after such adjustment, it will take 3000 years to be off by one day, which is very accurate for our daily application.
|
|
2007-9-30 17:31 |
|
|
knoppix7
银牌会员
    
积分 1287
发帖 634
注册 2007-5-2 来自 cmd.exe
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
Originally posted by s11ss at 2007-9-30 05:23 PM:
knoppix7,
你判断闰年的算法有问题.对于闰年的判断我过去也一直是一头雾水。
能被4或400整除的是闰年,这句话就相当于说能被4整除的是闰年,因为 ...
对不起。具体方法我是copy网上的.不过。我发现WXP的时间根本到不了2100年。
所以没算进去.
Originally posted by s11ss at 2007-9-30 05:23 PM:
knoppix7,
Your algorithm for determining leap years is problematic. I also used to be confused about how to determine leap years.
The statement that "a year divisible by 4 or 400 is a leap year" is equivalent to saying that a year divisible by 4 is a leap year, because...
I'm sorry. I specifically copied the method from the internet. However, I noticed that the time in WXP doesn't reach the year 2100.
So I didn't include it.
|
|
2007-9-30 17:59 |
|
|
knoppix7
银牌会员
    
积分 1287
发帖 634
注册 2007-5-2 来自 cmd.exe
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
Originally posted by slore at 2007-9-30 05:31 PM:
其实能被3200整除的不是闰年……这个说法太……不要说的让人产生反面是闰年的说法……
能被4整除,且不能被100整除的是闰年;或者能被400整除的 ...
哪计算方法是什么。。。。。
又不可能人工指定时间...
Originally posted by slore at 2007-9-30 05:31 PM:
Actually, the statement that "those divisible by 3200 are not leap years" is too... Don't make people think that the opposite is a leap year...
A leap year is divisible by 4 but not by 100, or divisible by 400...
What is the calculation method... There's no way to specify the time manually...
|
|
2007-9-30 18:04 |
|
|
knoppix7
银牌会员
    
积分 1287
发帖 634
注册 2007-5-2 来自 cmd.exe
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
我想到了。
用date命令判断。
事例:
C:\Documents and Settings\lenovo>date 2007-02-29(非闰年,所以...)
系统无法接受输入的日期。
输入新日期: (年月日)
C:\Documents and Settings\lenovo>date 2100-02-29(超过WXP的年数限制)
系统无法接受输入的日期。
输入新日期: (年月日)
C:\Documents and Settings\lenovo>date 2004-02-29(成功)
Last edited by knoppix7 on 2007-10-1 at 02:11 PM ]
I've got it.
Judge with the date command.
Example:
C:\Documents and Settings\lenovo>date 2007-02-29(Not a leap year, so...)
The system cannot accept the entered date.
Enter new date: (year month day)
C:\Documents and Settings\lenovo>date 2100-02-29(Exceeds the year limit of WXP)
The system cannot accept the entered date.
Enter new date: (year month day)
C:\Documents and Settings\lenovo>date 2004-02-29(Succeeds)
Last edited by knoppix7 on 2007-10-1 at 02:11 PM ]
|
|
2007-9-30 18:07 |
|
|
knoppix7
银牌会员
    
积分 1287
发帖 634
注册 2007-5-2 来自 cmd.exe
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
我想到的办法:
@echo off
set DD=%date:~0,10%
set runnian=0
date %y%-2-29|find "系统无法接受输入的日期。" >nul ||set runnian=1
date %DD%
不过我没有测试...
The method I thought of:
@echo off
set DD=%date:~0,10%
set runnian=0
date %y%-2-29|find "The system cannot accept the entered date." >nul ||set runnian=1
date %DD%
But I didn't test it...
|
|
2007-10-1 14:13 |
|
|