Function Reference


_Date_Time_TzSpecificLocalTimeToSystemTime

Converts a local time to a time in UTC

#include <Date.au3>
_Date_Time_TzSpecificLocalTimeToSystemTime ( $tLocalTime [, $tTimeZone = 0] )

Parameters

$tLocalTime a $tagSYSTEMTIME structure that specifies a local time or a pointer to it. The function converts this time to the corresponding UTC time.
$tTimeZone [optional] a $tagTIME_ZONE_INFORMATION structure that specifies the time zone of interest or a pointer to it.
If 0, the function uses the currently active time zone.

Return Value

Returns a $tagSYSTEMTIME structure containing the time in UTC.

Related

$tagSYSTEMTIME, $tagTIME_ZONE_INFORMATION

Example

#include "Extras\HelpFileInternals.au3"

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

Example()

Func Example()
    Local $tLocal, $tSystem

    ; Create GUI
    GUICreate("Time", 400, 300)
    _MemoCreate(2, 2, 396, 296, $WS_VSCROLL)
    GUISetState(@SW_SHOW)

    ; Convert system time to local time
    $tSystem = _Date_Time_GetSystemTime()
    $tLocal = _Date_Time_SystemTimeToTzSpecificLocalTime($tSystem)
    _MemoWrite("System time to local time .: " & _Date_Time_SystemTimeToDateTimeStr($tLocal))

    $tLocal = _Date_Time_GetLocalTime()
    $tSystem = _Date_Time_TzSpecificLocalTimeToSystemTime($tLocal)
    _MemoWrite("Local time to system time .: " & _Date_Time_SystemTimeToDateTimeStr($tSystem))

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