Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

What time is it?

May
12,846
164
I switched from Eastern Daylight Time (-240) to Eastern Standard Time (-300) on Sunday and my computer has been restarted since then. WMI seems to be aware of the current time zone offset.

Code:
v:\> echo %@wmi[.,"select Bias from Win32_timezone"]
-300

But it's reporting current times in the Eastern Daylight Time format. They are off by an hour. Below, %_time is correct.

Code:
v:\> echo %_time
12:40:22

v:\> echo %@wmi[.,"select LocalDateTime from Win32_OperatingSystem"]
20201104134032.263000-240

What do you see?
 
[C:\Users\Galloway\Desktop\Charles Browser Donloads]ver /r

TCC 25.00.29 x64 Windows 7 [Version 6.1.7601]
TCC Build 29 Windows 7 Build 7601 Service Pack 1
Registered to GALLOWAY-HP

[C:\Users\Galloway\Desktop\Charles Browser Donloads]echo %@wmi[.,"select Bias from Win32_timezone"]
-300

[C:\Users\Galloway\Desktop\Charles Browser Donloads]echo %_time
14:06:34

[C:\Users\Galloway\Desktop\Charles Browser Donloads]echo %@wmi[.,"select LocalDateTime from Win32_OperatingSystem"]
20201104140650.929000-300

[C:\Users\Galloway\Desktop\Charles Browser Donloads]echo %_STZN, %_STZO, %_TZN, %_TZO
Eastern Standard Time, 300, Eastern Standard Time, 300

[C:\Users\Galloway\Desktop\Charles Browser Donloads]
 
[C:\Users\Galloway\Desktop\Charles Browser Donloads]echo %@wmi[.,"select LocalDateTime from Win32_OperatingSystem"]
20201104140650.929000-300
That's what SHOULD be happening but it ain't happening here.
 
Is your PC fully updated, no service packs? I know some states are staying with standard time or whatever.
 
Is your PC fully updated, no service packs? I know some states are staying with standard time or whatever.
I suppose so. I let Windows Update do its thing.

Microsoft Windows 10 Pro for Workstations
10.0.18363.1139 (1909)
 
Charles, what does this one show you?

Code:
v:\> wmic timezone get * /format:value

Bias=-300
Caption=(UTC-05:00) Eastern Time (US & Canada)
DaylightBias=-60
DaylightDay=2
DaylightDayOfWeek=0
DaylightHour=2
DaylightMillisecond=0
DaylightMinute=0
DaylightMonth=3
DaylightName=Eastern Daylight Time
DaylightSecond=0
DaylightYear=0
Description=(UTC-05:00) Eastern Time (US & Canada)
SettingID=
StandardBias=0
StandardDay=1
StandardDayOfWeek=0
StandardHour=2
StandardMillisecond=0
StandardMinute=0
StandardMonth=11
StandardName=Eastern Standard Time
StandardSecond=0
StandardYear=0
 
Charles, what does this one show you?

Code:
v:\> wmic timezone get * /format:value

Bias=-300
Caption=(UTC-05:00) Eastern Time (US & Canada)
DaylightBias=-60
DaylightDay=2
DaylightDayOfWeek=0
DaylightHour=2
DaylightMillisecond=0
DaylightMinute=0
DaylightMonth=3
DaylightName=Eastern Daylight Time
DaylightSecond=0
DaylightYear=0
Description=(UTC-05:00) Eastern Time (US & Canada)
SettingID=
StandardBias=0
StandardDay=1
StandardDayOfWeek=0
StandardHour=2
StandardMillisecond=0
StandardMinute=0
StandardMonth=11
StandardName=Eastern Standard Time
StandardSecond=0
StandardYear=0
C:\Users\Galloway\Desktop\Text]wmic timezone get * /format:value


Bias=-300
Caption=(UTC-05:00) Eastern Time (US & Canada)
DaylightBias=-60
DaylightDay=2
DaylightDayOfWeek=0
DaylightHour=2
DaylightMillisecond=0
DaylightMinute=0
DaylightMonth=3
DaylightName=Eastern Daylight Time
DaylightSecond=0
DaylightYear=0
Description=(UTC-05:00) Eastern Time (US & Canada)
SettingID=
StandardBias=0
StandardDay=1
StandardDayOfWeek=0
StandardHour=2
StandardMillisecond=0
StandardMinute=0
StandardMonth=11
StandardName=Eastern Standard Time
StandardSecond=0
StandardYear=0
 
No. And WMI is not even consistent.

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

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

LocalDateTime
20201110112347.112000-300
 
I didn't look carefully enough. Both commands in my previous post have it right. That's new. But process CreationDates are still in the DST format (and wrong).

Code:
v:\> echo %@wmi[.,"select creationdate from win32_process where processid=%_pid"]
20201110123034.391418-240
 
I didn't look carefully enough. Both commands in my previous post have it right. That's new. But process CreationDates are still in the DST format (and wrong).

Code:
v:\> echo %@wmi[.,"select creationdate from win32_process where processid=%_pid"]
20201110123034.391418-240
[C:\Users\Galloway\Desktop\Text]ver /r

TCC 25.00.29 x64 Windows 7 [Version 6.1.7601]
TCC Build 29 Windows 7 Build 7601 Service Pack 1
Registered to GALLOWAY-HP

[C:\Users\Galloway\Desktop\Text]WMIC.exe Path Win32_LocalTime Get /Format:value & wmic path win32_operatingsystem get localdatetime


Day=10
DayOfWeek=2
Hour=12
Milliseconds=
Minute=37
Month=11
Quarter=4
Second=20
WeekInMonth=2
Year=2020



LocalDateTime
20201110123721.113000-300


[C:\Users\Galloway\Desktop\Text]echo %@wmi[.,"select creationdate from win32_process where processid=%_pid"]
20201110123705.206139-300

[C:\Users\Galloway\Desktop\Text]
 
Finally, after restarting the Winmgmt service things are OK. Here's what seems to have happened.

Even though the system time was changed at the right time, and there were several restarts in the next week, some component of WMI didn't go to standard time until the next Sunday; that's when it started reporting the correct LocalDateTime. And after that, some other component of WMI needed a restart (today) before it correctly reported process CreationDates.

I don't remember the details but something weird like that also happened in March, when DST started.
 
Well, I thought things were better. I just did these, about 5 minutes apart. It seems flaky to me!

1605052005555.png
 
Back
Top