解码一个系统时间到一个日期字符串
#Include <Date.au3>
_Date_Time_SystemTimeToDateStr(ByRef $tSystemTime [, $bFmt = 0])
$tSystemTime | $tagSYSTEMTIME 数据结构 |
$bFmt | [可选参数] 0 返回 mm/dd/yyyy (默认) 1 返回 yyyy/mm/dd |
#include <GUIConstantsEx.au3>
#include <Date.au3>
#include <WindowsConstants.au3>
Global $iMemo
_Main()
Func _Main()
Local $tDate
; 创建 GUI
GUICreate("Time", 400, 300)
$iMemo = GUICtrlCreateEdit("", 2, 2, 396, 296, $WS_VSCROLL)
GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
GUISetState()
; 获取当前系统日期
$tDate = _Date_Time_GetSystemTime()
MemoWrite("Current system date .: " & _Date_Time_SystemTimeToDateStr($tDate))
MemoWrite("Current system date .: " & _Date_Time_SystemTimeToDateStr($tDate, 1))
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>_Main
; 写入一行到 memo 控件
Func MemoWrite($sMessage)
GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite