Function Reference

_Date_Time_SystemTimeToTzSpecificLocalTime

UTC時刻を指定したタイムゾーンの対応する地域時刻に変換します。

#Include <Date.au3>
_Date_Time_SystemTimeToTzSpecificLocalTime($pUTC [, $pTimeZone = 0])

 

パラメータ

$pUTC UTCでの時刻を指定する$tagSYSTEMTIME構造体のポインタ。
この関数はこれを指定されたタイムゾーンの地域時刻に変換します。
$pTimeZone [オプション]知りたいタイムゾーンを指定する$tagTIME_ZONE_INFORMATION構造体のポインタ。
0を指定した場合、この関数は現在アクティブなタイムゾーンを使用します。

 

返し値

地域時刻を格納した$tagSYSTEMTIMEを返します。

 

注意

なし。

 

関連

$tagSYSTEMTIME, $tagTIME_ZONE_INFORMATION

 


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

Global $iMemo

_Main()

Func _Main()
    Local $hGUI, $tLocal, $tSystem

    ; GUIを作成
    $hGUI = GUICreate("Time", 400, 300)
    $iMemo = GUICtrlCreateEdit("", 2, 2, 396, 296, $WS_VSCROLL)
    GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")
    GUISetState()

    ; システム時間を地域時刻に変換
    $tSystem = _Date_Time_GetSystemTime()
    $tLocal  = _Date_Time_SystemTimeToTzSpecificLocalTime(DllStructGetPtr($tSystem))
    MemoWrite("System time to local time .: " & _Date_Time_SystemTimeToDateTimeStr($tLocal ))

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

    ; ユーザーが終了するまでループ
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
   
EndFunc   ;==>_Main

; メモコントロールに1行書き込む
Func MemoWrite($sMessage)
    GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite