Modify

Opened 9 years ago

Closed 9 years ago

#3534 closed Bug (No Bug)

GetTimeZoneInformation missing date/time

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: 3.3.14.0 Severity: None
Keywords: Cc:

Description

This script:

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

; Under Vista the Windows API "SetTimeZoneInformation" may be rejected due to system security

Global $iMemo

_Main()

Func _Main()
    Local $aOld, $aNew

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

    ; Show current time zone information
    $aOld = _Date_Time_GetTimeZoneInformation()
    ShowTimeZoneInformation($aOld, "Current")

    ; Loop until user exits
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

EndFunc   ;==>_Main

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

; Show time zone information
Func ShowTimeZoneInformation(ByRef $aInfo, $comment)
    MemoWrite("******************* " & $comment & " *******************")
    MemoWrite("Result ............: " & $aInfo[0])
    MemoWrite("Current bias ......: " & $aInfo[1])
    MemoWrite("Standard name .....: " & $aInfo[2])
    MemoWrite("Standard date/time : " & _Date_Time_SystemTimeToDateTimeStr($aInfo[3]))
    MemoWrite("Standard bias......: " & $aInfo[4])
    MemoWrite("Daylight name .....: " & $aInfo[5])
    MemoWrite("Daylight date/time : " & _Date_Time_SystemTimeToDateTimeStr($aInfo[6]))
    MemoWrite("Daylight bias......: " & $aInfo[7])
EndFunc   ;==>ShowTimeZoneInformation

Return me:

******************* Current *******************
Result ............: 1
Current bias ......: -60
Standard name .....: ora solare Europa occidentale
Standard date/time : 10/05/0000 03:00:00
Standard bias......: 0
Daylight name .....: ora solare Europa occidentale
Daylight date/time : 03/05/0000 02:00:00
Daylight bias......: -60

Has you can see "Standard date/time" and "Daylight date/time" are totally wrong except for hours. Correct one in my case are 29/10/2017 03:00:00 and 26/03/2017 02:00:00
Same problem with old stable 3.3.8.1. Probably an error in the TAG or _Date_Time_SystemTimeToDateTimeStr?

Attachments (0)

Change History (4)

comment:2 by jchd18, 9 years ago

Resolution: No Bug
Status: newclosed

Ignore

Version 1, edited 9 years ago by jchd18 (previous) (next) (diff)

comment:3 by jchd18, 9 years ago

Resolution: No Bug
Status: closedreopened

comment:4 by jchd18, 9 years ago

Resolution: No Bug
Status: reopenedclosed

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.