Modify

Opened 8 years ago

Closed 8 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:1 Changed 8 years ago by anonymous

comment:2 Changed 8 years ago by jchd18

  • Resolution set to No Bug
  • Status changed from new to closed

_Date_Time_GetTimeZoneInformation() returns the correct information, as specified in the help file.

Last edited 8 years ago by jchd18 (previous) (diff)

comment:3 Changed 8 years ago by jchd18

  • Resolution No Bug deleted
  • Status changed from closed to reopened

comment:4 Changed 8 years ago by jchd18

  • Resolution set to No Bug
  • Status changed from reopened to closed

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.