转换一个基于全球协调时(UTC)的文件时间到本地文件时间
#Include <Date.au3>
_Date_Time_FileTimeToLocalFileTime($pFileTime)
$pFileTime | $tagFILETIME 结构指针,包含基于文件的 UTC 时间转换为本地时间. |
#include <GUIConstantsEx.au3>
#include <Date.au3>
#include <WindowsConstants.au3>
Global $iMemo
_Main()
Func _Main()
Local $tFile, $tLocal
; 创建 GUI
GUICreate("Time", 400, 300)
$iMemo = GUICtrlCreateEdit("", 2, 2, 396, 296, $WS_VSCROLL)
GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
GUISetState()
; 获取系统时间
Local $tSystem = _Date_Time_GetSystemTime()
$tFile = _Date_Time_SystemTimeToFileTime(DllStructGetPtr($tSystem))
; --------------------------------------
$tLocal = _Date_Time_FileTimeToLocalFileTime(DllStructGetPtr($tFile))
MemoWrite("Local file time .: " & _Date_Time_FileTimeToStr($tLocal))
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>_Main
; 写入一行到 memo 控件
Func MemoWrite($sMessage)
GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite