system time for programs is 2 hours back! (UTC instead of local time) RRS feed

  • Question

  • Hello I noticed a very weird thing happening on some computers in our company. I develop some scripts which log messages with timestamp into logfiles and suddendly it started to log timestamps 2 hours back! The system clock is OK, but it seems that all the software on a machine somehow gets bad time from a system.

    Our timezone is UTC+1 and +DST so we have 11:00 when UTC is 9:00. Even symantec antivirus logs that test scan was started at 9:00 even when the system clock shows it is 11:00. WTH is it? I reinstalled one of the affected pc and it was fixed for a few days but today I noticed this behavior again!

    DllCall("kernel32.dll", "none", "GetLocalTime"...) gets me a proper local time, but programming macros like @hour in Autoit shows UTC time instead. I have no idea what can be different on those few machines (not exactly sure how many of them there is yet), because we have a company system image which is the same everywhere. Thank you for any ideas...

    Friday, September 23, 2011 9:25 AM

All replies

  • anyone? This is quite serious!
    Monday, September 26, 2011 10:55 AM
  • oh come on. Where are all the programmers??
    Tuesday, September 27, 2011 8:49 PM
  •   Most of them will be over at MSDN. Tehnet is for techies, not devs.


    Tuesday, September 27, 2011 11:20 PM

    Func API_GetLocalTime()
        Local $stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort')
        DllCall('kernel32.dll', 'none', 'GetLocalTime', 'ptr', DllStructGetPtr($stSystemTime))
        Local $gst=DllStructGetData($stSystemTime, 5)
        For $i = 6 to 6
            $gst = $gst & ":" & DllStructGetData($stSystemTime, $i)
        $stSystemTime = 0; free structure from memory
        return $gst

    MCP, MCTS, MCTS: Exchagne 2007
    Wednesday, September 28, 2011 1:18 AM
  • that is the function I have and what works, but I can only fix my scripts with it but what about all the other software what is running on the pc?

    And guess what happened today (or maybe it was before already but I did not notice) - I started to have this problem on my Win 7 thinkpad! So it is not exclusive for Windows XP. It almost looks like some kind of infection I got also because I was trying to fix it :-\

    Thursday, September 29, 2011 2:40 PM