Win10, WMI showing Daylight time strings?

Vincent Fatica 6 Reputation points
2020-11-04T18:38:53.997+00:00

Microsoft Windows 10 Pro for Workstations
10.0.18363.1139 (1909)

On Sunday we switched from Eastern Daylight Time (-240) to Eastern Standard Time (-300). Since then my computer has been restarted (cold, twice) and it has the correct time.

Why does WMI return datetime strings formatted for Eastern Daylight Time? The time below is wrong.

v:\> wmic os get localdatetime
LocalDateTime
20201104142641.300000-240

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,500 questions
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Jenny Yan-MSFT 9,336 Reputation points
    2020-11-05T06:16:53.53+00:00

    Hi,
    Kindly check if this explains:
    https://serverfault.com/questions/991821/subsequent-calls-to-wmic-return-a-localdatetime-with-a-deviating-timezone
    Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.


    Hope this helps and please help to accept as Answer if the response is useful.

    Thanks,
    Jenny

    0 comments No comments

  2. Vincent Fatica 6 Reputation points
    2020-11-05T16:56:14.567+00:00

    I don't think that article explains it but it does give me a way to show a discrepancy. These disagree:

    v:\> WMIC.exe Path Win32_LocalTime Get /Format:value

    Day=5
    DayOfWeek=4
    Hour=11
    Milliseconds=
    Minute=29
    Month=11
    Quarter=4
    Second=30
    WeekInMonth=1
    Year=2020

    v:\> wmic path win32_operatingsystem get localdatetime
    LocalDateTime
    20201105122939.471000-240

    That article mentions "InstallDate" but doesn't say where to find it.

    I use this sort of query often: "Select CreationDate from Win32_Process where ProcessId=%PID". Without fail, those queries return a Daylight time, which is one hour off.

    I have this, which looks correct.

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation
    Bias REG_DWORD 0x12c
    DaylightBias REG_DWORD 0xffffffc4
    DaylightName REG_SZ @tzres.dll,-111
    DaylightStart REG_BINARY 00000300020002000000000000000000
    DynamicDaylightTimeDisabled REG_DWORD 0x0
    StandardBias REG_DWORD 0x0
    StandardName REG_SZ @tzres.dll,-112
    StandardStart REG_BINARY 00000B00010002000000000000000000
    TimeZoneKeyName REG_SZ Eastern Standard Time
    ActiveTimeBias REG_DWORD 0x12c

    I also had this problem (actually the opposite problem) in March when Daylight time began but restarting the computer fixed it.

    0 comments No comments

  3. Vincent Fatica 6 Reputation points
    2020-11-06T05:01:13.01+00:00

    I also found "InstallDate", apparently the one WMI uses for Win32_OperatingSystem::InstallDate. It's in HKLM\Software\Microsoft\Windows NT\CurrentVersion. I changed it to a time representing today (it's actually a Unix time) ... restarted the computer ... no joy! WMI is still reporting times as if Daylight Time is in effect.

    v:\> wmic OS get installdate
    InstallDate
    20201105115911.000000-240

    0 comments No comments

  4. Vincent Fatica 6 Reputation points
    2020-11-10T16:58:17.807+00:00

    Something has changed over the weekend. These two now agree and the second is reported with the correct -300 offset.

    v:\> WMIC.exe Path Win32_LocalTime Get /Format:value & wmic path win32_operatingsystem get localdatetime

    Day=10
    DayOfWeek=2
    Hour=11
    Milliseconds=
    Minute=38
    Month=11
    Quarter=4
    Second=30
    WeekInMonth=2
    Year=2020

    LocalDateTime
    20201110113830.983000-300

    But process CreationDates are still reported as if Daylight Time is in effect.

    v:\> echo %@wmi[.,"select creationdate from win32_process where processid=9264"]
    20201110123034.391418-240

    0 comments No comments

  5. Vincent Fatica 6 Reputation points
    2020-11-10T23:49:42.677+00:00

    It's crazy!

    38758-image.png

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.