ENVI^ ALIAS -opt FileTimeToSystemTime=CALL $--ret:* Kernel32.DLL,FileTimeToSystemTime,
ENVI^ ALIAS -opt FileTimeToLocalFileTime=CALL $--ret:* Kernel32.DLL,FileTimeToLocalFileTime,
ENVI^ ALIAS -opt SystemTimeToFileTime=CALL $--ret:* Kernel32.DLL,SystemTimeToFileTime,
ENVI^ ALIAS -opt LocalFileTimeToFileTime=CALL $--ret:* Kernel32.DLL,LocalFileTimeToFileTime,

ENVI &&ct=130066807416533454
DATE &&ct utc



TEAM ENVI &&Year=|ENVI &&Month=|ENVI &&Day=|ENVI &&Hour=|ENVI &&Minute=|ENVI &&Second=|ENVI &&Milliseconds=|ENVI &&Week=|

UTC2System  %&ct%
ENVI &&TM1=%&Year%-%&Month%-%&Day% %&Hour%:%&Minute%:%&Second%
UTC2Local %&ct%
MESS UTC  %&ct%\n国际时间 %&&TM1%\n本地时间 %&Year%-%&Month%-%&Day% %&Hour%:%&Minute%:%&Second%  


_SUB UTC2System
    ENVI &&ct=%1
    ENVI &&HEX=
    LOOP #%&ct%=0,!  
    {
        CALC -base=16 #&&v=%ct% % 0x100
        ENVI &HEX=%&HEX% %&v%
        CALC #&ct=%ct% / 0x100
    }

    ENVI#$ &&ctb=%&HEX% *8 0x00  //补足8个
    ENVI#$ &&systm=*32 0   
    ENVI-addr &&ctbadr=&ctb
    ENVI-addr &&systmadr=&systm
    GETF -bin &ctb,0#*,&&ctbHex
    FileTimeToSystemTime &&ret,#%&ctbadr%,#%&systmadr%
    GETF -bin &systm,0#*,&&systmHex
    MSTR &&wYear1,&&wYear2,&&wMonth1,&&wMonth2,&&wDayOfWeek1,&&wDayOfWeek2,&&wDay1,&&wDay2,&&wHour1,&&wHour2,&&wMinute1,&&wMinute2,&&wSecond1,&&wSecond2,&&wMilliseconds1,&&wMilliseconds2=<1*>%&systmHex% 
    CALC &Year=%&wYear1% + 0x100 * %&wYear2%
    CALC &Month=%&wMonth1% + 0x100 * %&wMonth2%
    //CALC &Week=%&wDayOfWeek1% + 0x100 * %&wDayOfWeek2% //星期
    CALC &Day=%&wDay1% + 0x100 * %&wDay2%
    CALC &Hour=%&wHour1% + 0x100 * %&wHour2%
    CALC &Minute=%&wMinute1% + 0x100 * %&wMinute2%
    CALC &Second=%&wSecond1% + 0x100 * %&wSecond2%
    //CALC &Milliseconds=%&wMilliseconds1% + 0x100 * %&wMilliseconds2% //毫秒
_END


_SUB UTC2Local
    ENVI &&ct=%1
    DATE &&zone zone
    CALC #&&ct=%&ct% + %&zone% * 36000000000  //加上时区
    UTC2System %&ct%
_END





