set /P realtime="输入时间点(年月日时分秒),如. 20061031211600 :"
::setlocal ENABLEEXTENSIONS
set yy=%realtime:~0,4%&set mm=%realtime:~4,2%&set dd=%realtime:~6,2%&set hh=%realtime:~8,2%&set nn=%realtime:~10,2%&set ss=%realtime:~12,2%
if 1%yy% LSS 200 if 1%yy% LSS 170 (set yy=20%yy%) else (set yy=19%yy%)
set /a dd=100%dd%%%100,mm=100%mm%%%100
set /a z=14-mm,z/=12,y=yy+4800-z,m=mm+12*z-3,j=153*m+2
set /a j=j/5+dd+y*365+y/4-y/100+y/400-2472633
if 1%hh% LSS 20 set hh=0%hh%
if {%nn:~2,1%} EQU {p} if "%hh%" NEQ "12" set hh=1%hh%&set/a hh-=88
if {%nn:~2,1%} EQU {a} if "%hh%" EQU "12" set hh=00
if {%nn:~2,1%} GEQ {a} set nn=%nn:~0,2%
set /a hh=100%hh%%%100,nn=100%nn%%%100,ss=100%ss%%%100
set /a j=j*86400+hh*3600+nn*60+ss-8*60*60
echo %j%
::endlocal
set UPDATETM=%j%000
echo %UPDATETM%>time.txt作者: novaa 时间: 2008-1-15 10:49