Function Reference


_Date_Time_SystemTimeToDateTimeStr

Decode a system time to a date/time string

#include <Date.au3>
_Date_Time_SystemTimeToDateTimeStr ( ByRef $tSYSTEMTIME [, $iFmt = 0 [, $iType = 0]] )

Parameters

$tSYSTEMTIME $tagSYSTEMTIME structure
$iFmt [optional] 0 returns mm/dd/yyyy hh:mm:ss (Default)
1 returns yyyy/mm/dd hh:mm:ss
2 returns wday, nn MMM yyyy hh:mm:ss GMT
3 returns yyyy/mm/ddThh:mm:ssZ (ISO8601)
    or yyyy/mm/ddThh:mm:ss-hh:mm
$iType [optional] 0 $tSYSTEMTIME contain a System Time (Default)
1 $tSYSTEMTIME contain a Local Time

Return Value

Returns a date/time string formatted as defined by $iFmt.

Related

$tagSYSTEMTIME, _Date_Time_SystemTimeToDateStr, _Date_Time_SystemTimeToTimeStr

Example

#include <Date.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $g_idMemo

Example()

Func Example()
        Local $tTime

        ; Create GUI
        GUICreate("Date/Time", 500, 300)
        $g_idMemo = GUICtrlCreateEdit("", 2, 2, 496, 296, $WS_VSCROLL)
        GUICtrlSetFont($g_idMemo, 9, 400, 0, "Courier New")
        GUISetState(@SW_SHOW)

        ; Show system date/time
        $tTime = _Date_Time_GetSystemTime()
        MemoWrite("System date/time (0)       : " & _Date_Time_SystemTimeToDateTimeStr($tTime))
        MemoWrite("System date/time (1)       : " & _Date_Time_SystemTimeToDateTimeStr($tTime, 1))
        MemoWrite("System date/time (ISO8601) : " & _Date_Time_SystemTimeToDateTimeStr($tTime, 3, 1))
        MemoWrite("System date/time (GMT)     : " & _Date_Time_SystemTimeToDateTimeStr($tTime, 2, 1))
        ; Show local date/time
        $tTime = _Date_Time_GetLocalTime()
        MemoWrite("Local  date/time (GMT)     : " & _Date_Time_SystemTimeToDateTimeStr($tTime, 2))
        MemoWrite("Local  date/time (ISO8601) : " & _Date_Time_SystemTimeToDateTimeStr($tTime, 3))

        ; Loop until the user exits.
        Do
        Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example

; Write a line to the memo control
Func MemoWrite($sMessage)
        GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite