|
| |||
| Re: Time Error On Nov 4, 4:48*pm, RWW-MCW <rth.wil...******.com> wrote: > On Nov 4, 2:41*pm, "Pegasus [MVP]" <n...@microsoft.com> wrote: > > > "Meanon" <mea...@telus.net> wrote in message > > >news:fa091d4e-da36-4e7d-a066-0e6865ae386a@2g2000prl.googlegroups.com... > > On Nov 4, 10:26 am, RWW-MCW <rth.wil...******.com> wrote: > > > > On Nov 2, 5:43 pm, Meanon <mea...@telus.net> wrote: > > > > > Since the time change on Sunday my WinXP Pro computer shows the right > > > > time in the Windows clock (in the system tray), but programs that use > > > > a function call to get the time from the operating system are 1 hour > > > > ahead. I recall something similar happened the last time the clocks > > > > changed. > > > > > Does anyone know of a fix for this? > > > > We're seeing a problem in the WMI Win32_OperatingSystem class. The > > > LocalDateTime is reporting an hour ahead. Anything that uses this > > > value is an hour off. (We first noticed it when our SCCM-based > > > WakeOnLAN started waking computers up an hour early.) > > > Thanks, looks like I'm not going crazy after all! Now I just have to > > find a fix/patch to fix it. > > ============ > > If the class mentioned by RWW is behind this phenomenon then you shouldbe > > able to reproduce it with the .vbs code below. Note that it reports your > > current time zone. If that number is incorrect then you will get incorrect > > results. You can probably check this with Microsoft's TimeZone tool:http://www.microsoft.com/downloads/t...Id=07fb0bd8-f3.... > > > Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2") > > Set colItems = objWMIService.ExecQuery( _ > > * *"SELECT * FROM Win32_OperatingSystem",,48) > > For Each objItem In colItems > > * *WScript.Echo "CurrentTimeZone: " & objItem.CurrentTimeZone > > * *dtmLocalTime = objItem.LocalDateTime > > * *dtmMonth = Mid(dtmLocalTime, 5, 2) > > * *dtmDay = Mid(dtmLocalTime, 7, 2) > > * *dtmYear = Left(dtmLocalTime, 4) > > * *dtmHour = Mid(dtmLocalTime, 9, 2) > > * *dtmMinutes = Mid(dtmLocalTime, 11, 2) > > * *dtmSeconds = Mid(dtmLocalTime, 13, 2) > > * *MsgBox "Time Zone=" & objItem.CurrentTimeZone & Chr(10) _ > > * *& "Date=" & dtmMonth & "/" & dtmDay & "/" & dtmYear & Chr(10) _ > > * *& "Time=" & dtmHour & ":" & dtmMinutes & ":" & dtmSeconds > > Next > > I should have included more detail on this. *The weird part is that > the timezone and DST values are correct, in both Win32_TimeZone and in > Win32_OperatingSystem, but the LocalDateTime is an hour off. *The time > shows up correctly in the Windows GUI, but the LocalDateTime value > doesn't match. *Also, the time values in Win32_LocalTime are correct, > but the LocalDateTime value in Win32_OperatingSystem doesn't match. > Very strange. More details. The value that displays in in LocalDateTime (viewed with WMI CIM Studio) includes "...GMT-04:00". We're in the US Eastern Time Zone and just went from Daylight to Standard time. So, the LocalDateTime value should include "...GMT-05:00". Everywhere everywhere else I look has the 5-hour offset. I'm seeing this on both Windows XP SP3 and Vista SP2. For what it's worth, the closest thing I've found that's similar to my issue (thought not exactly) after extensive searching is this report from back in March: http://connect.microsoft.com/VisualS...dbackID=422388 |
| |||
| Re: Time Error On Nov 4, 2:06*pm, RWW-MCW <rth.wil...******.com> wrote: > On Nov 4, 4:48*pm, RWW-MCW <rth.wil...******.com> wrote: > > > > > > > On Nov 4, 2:41*pm, "Pegasus [MVP]" <n...@microsoft.com> wrote: > > > > "Meanon" <mea...@telus.net> wrote in message > > > >news:fa091d4e-da36-4e7d-a066-0e6865ae386a@2g2000prl.googlegroups.com.... > > > On Nov 4, 10:26 am, RWW-MCW <rth.wil...******.com> wrote: > > > > > On Nov 2, 5:43 pm, Meanon <mea...@telus.net> wrote: > > > > > > Since the time change on Sunday my WinXP Pro computer shows the right > > > > > time in the Windows clock (in the system tray), but programs thatuse > > > > > a function call to get the time from the operating system are 1 hour > > > > > ahead. I recall something similar happened the last time the clocks > > > > > changed. > > > > > > Does anyone know of a fix for this? > > > > > We're seeing a problem in the WMI Win32_OperatingSystem class. The > > > > LocalDateTime is reporting an hour ahead. Anything that uses this > > > > value is an hour off. (We first noticed it when our SCCM-based > > > > WakeOnLAN started waking computers up an hour early.) > > > > Thanks, looks like I'm not going crazy after all! Now I just have to > > > find a fix/patch to fix it. > > > ============ > > > If the class mentioned by RWW is behind this phenomenon then you should be > > > able to reproduce it with the .vbs code below. Note that it reports your > > > current time zone. If that number is incorrect then you will get incorrect > > > results. You can probably check this with Microsoft's TimeZone tool:http://www.microsoft.com/downloads/t...Id=07fb0bd8-f3.... > > > > Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2") > > > Set colItems = objWMIService.ExecQuery( _ > > > * *"SELECT * FROM Win32_OperatingSystem",,48) > > > For Each objItem In colItems > > > * *WScript.Echo "CurrentTimeZone: " & objItem.CurrentTimeZone > > > * *dtmLocalTime = objItem.LocalDateTime > > > * *dtmMonth = Mid(dtmLocalTime, 5, 2) > > > * *dtmDay = Mid(dtmLocalTime, 7, 2) > > > * *dtmYear = Left(dtmLocalTime, 4) > > > * *dtmHour = Mid(dtmLocalTime, 9, 2) > > > * *dtmMinutes = Mid(dtmLocalTime, 11, 2) > > > * *dtmSeconds = Mid(dtmLocalTime, 13, 2) > > > * *MsgBox "Time Zone=" & objItem.CurrentTimeZone & Chr(10) _ > > > * *& "Date=" & dtmMonth & "/" & dtmDay & "/" & dtmYear & Chr(10) _ > > > * *& "Time=" & dtmHour & ":" & dtmMinutes & ":" & dtmSeconds > > > Next > > > I should have included more detail on this. *The weird part is that > > the timezone and DST values are correct, in both Win32_TimeZone and in > > Win32_OperatingSystem, but the LocalDateTime is an hour off. *The time > > shows up correctly in the Windows GUI, but the LocalDateTime value > > doesn't match. *Also, the time values in Win32_LocalTime are correct, > > but the LocalDateTime value in Win32_OperatingSystem doesn't match. > > Very strange. > > More details. *The value that displays in in LocalDateTime (viewed > with WMI CIM Studio) includes "...GMT-04:00". *We're in the US Eastern > Time Zone and just went from Daylight to Standard time. *So, the > LocalDateTime value should include "...GMT-05:00". *Everywhere > everywhere else I look has the 5-hour offset. *I'm seeing this on both > Windows XP SP3 and Vista SP2. > > For what it's worth, the closest thing I've found that's similar to my > issue (thought not exactly) after extensive searching is this report > from back in March:http://connect.microsoft.com/VisualS...back.aspx?...- Hide quoted text - > > - Show quoted text - One more data point: I'm also seeing the same results in Windows 7. |
| |||
| Re: Time Error More details: 1. The LastBootUpTime value in Win32_OperatingSystem is also an hour off. 2. The =Now() function in Excel displays the correct time. 3. I also get the correct time when I run the Time command in a command prompt DOS-style shell. 4. To prove that all other settings are correct and that there is definitely an illogical discrepancy in WMI, I came up with the script code below, ran it, and copied the output further below. SCRIPT: ========================= Set objWMIService = GetObject("winmgmts:\\.\root\cimv2") WScript.Echo "Script executed: " & Now() WScript.Echo Set colItems = objWMIService.ExecQuery(_ "Select * From Win32_OperatingSystem") For Each objItem in colItems WScript.Echo "Win32_OperatingSystem:" WScript.Echo "Caption = " & objItem.Caption WScript.Echo "CSDVersion = " & objItem.CSDVersion WScript.Echo "OSArchitecture = " & objItem.OSArchitecture WScript.Echo "ServicePackMajorVersion = " & _ objItem.ServicePackMajorVersion WScript.Echo "ServicePackMinorVersion = " & _ objItem.ServicePackMinorVersion WScript.Echo "Version = " & objItem.Version strLocalDateTime = objItem.LocalDateTime WScript.Echo "CurrentTimeZone = " & _ objItem.CurrentTimeZone WScript.Echo "LocalDateTime = " & objItem.LocalDateTime strTime = Mid(strLocalDateTime, 9, 2) & ":" & _ Mid(strLocalDateTime, 11, 2) & ":" & _ Mid(strLocalDateTime, 13, 2) strDate = Mid(strLocalDateTime, 5, 2) & "/" & _ Mid(strLocalDateTime, 7, 2) & "/" & _ Left(strLocalDateTime, 4) strTZ = Right(strLocalDateTime, Len(strLocalDateTime)-21) dtmDateTime = CDate(strDate & " " & strTime) Wscript.Echo "LocalDateTime = " & dtmDateTime & _ " (GMT" & strTZ & ")" Wscript.Echo "----------" Next Set colItems = objWMIService.ExecQuery(_ "Select * From Win32_LocalTime") For Each objItem in colItems strTime = objItem.Hour & ":" & objItem.Minute & ":" & _ objItem.Second strDate = objItem.Month & "/" & objItem.Day & "/" & _ objItem.Year dtmDateTime = CDate(strDate & " " & strTime) WScript.Echo "Win32_LocalTime:" Wscript.Echo "LocalTime = " & dtmDateTime Wscript.Echo "----------" Next Set colItems = objWMIService.ExecQuery(_ "Select * From Win32_UTCTime") For Each objItem in colItems strTime = objItem.Hour & ":" & _ objItem.Minute & ":" & objItem.Second strDate = objItem.Month & "/" & _ objItem.Day & "/" & objItem.Year dtmDateTime = CDate(strDate & " " & strTime) WScript.Echo "Win32_UTCTime:" Wscript.Echo "UTCTime = " & dtmDateTime Wscript.Echo "----------" Next Set colItems = objWMIService.ExecQuery(_ "Select * From Win32_ComputerSystem") For Each objItem in colItems WScript.Echo "Win32_ComputerSystem:" WScript.Echo "CurrentTimeZone = " & _ objItem.CurrentTimeZone WScript.Echo "DaylightInEffect = " & _ objItem.DaylightInEffect WScript.Echo "EnableDaylightSavingsTime = " & _ objItem.EnableDaylightSavingsTime Wscript.Echo "----------" Next Set colItems = objWMIService.ExecQuery(_ "Select * From Win32_TimeZone") For Each objItem in colItems WScript.Echo "Win32_TimeZone:" WScript.Echo "Description = " & objItem.Description WScript.Echo "Bias = " & objItem.Bias WScript.Echo "DaylightBias = " & objItem.DaylightBias WScript.Echo "Daylight Month/Day = " & _ objItem.DaylightMonth & "/" & objItem.DaylightDay WScript.Echo "DaylightName = " & objItem.DaylightName WScript.Echo "StandardBias = " & objItem.StandardBias WScript.Echo "Standard Month/Day = " & _ objItem.StandardMonth & "/" & objItem.StandardDay WScript.Echo "StandardName = " & objItem.StandardName Next ========================= OUTPUT: ========================= Script executed: 11/5/2009 12:29:08 PM Win32_OperatingSystem: Caption = Microsoftr Windows VistaT Enterprise CSDVersion = Service Pack 2 OSArchitecture = 32-bit ServicePackMajorVersion = 2 ServicePackMinorVersion = 0 Version = 6.0.6002 CurrentTimeZone = -300 LocalDateTime = 20091105132908.265000-240 LocalDateTime = 11/5/2009 1:29:08 PM (GMT-240) ---------- Win32_LocalTime: LocalTime = 11/5/2009 12:29:08 PM ---------- Win32_UTCTime: UTCTime = 11/5/2009 5:29:08 PM ---------- Win32_ComputerSystem: CurrentTimeZone = -300 DaylightInEffect = False EnableDaylightSavingsTime = True ---------- Win32_TimeZone: Description = (GMT-05:00) Eastern Time (US & Canada) Bias = -300 DaylightBias = -60 Daylight Month/Day = 3/2 DaylightName = Eastern Daylight Time StandardBias = 0 Standard Month/Day = 11/1 StandardName = Eastern Standard Time ========================= Note that the time and offset/bias values for LocalDateTime do not match ANY other values. The LocalDateTime value, and anything that uses it, are simply WRONG. (I haven't tested the script on WinXP, but the discrepancies are the same in XP when viewed via CIM Studio.) I would also point out that the old time change from EDT to EST was a week EARLIER than it is now. So, nothing will be any different in mid- November in our area (as Meanon indicated might be the case for his area). Is anyone else seeing this? I would love to hear back from Pegasus or any other MVPs... or anyone for that matter. Thanks. |
| |||
| Re: Time Error Did you visit http://support.microsoft.com/gp/cp_dst ??? "Meanon" <meanon@telus.net> wrote in message news:3f574d3f-6a47-4b95-b793-c608d2582637@y28g2000prd.googlegroups.com... On Nov 4, 2:06 pm, RWW-MCW <rth.wil...******.com> wrote: > On Nov 4, 4:48 pm, RWW-MCW <rth.wil...******.com> wrote: > > > > > > > On Nov 4, 2:41 pm, "Pegasus [MVP]" <n...@microsoft.com> wrote: > > > > "Meanon" <mea...@telus.net> wrote in message > > > >news:fa091d4e-da36-4e7d-a066-0e6865ae386a@2g2000prl.googlegroups.com... > > > On Nov 4, 10:26 am, RWW-MCW <rth.wil...******.com> wrote: > > > > > On Nov 2, 5:43 pm, Meanon <mea...@telus.net> wrote: > > > > > > Since the time change on Sunday my WinXP Pro computer shows the > > > > > right > > > > > time in the Windows clock (in the system tray), but programs that > > > > > use > > > > > a function call to get the time from the operating system are 1 > > > > > hour > > > > > ahead. I recall something similar happened the last time the > > > > > clocks > > > > > changed. > > > > > > Does anyone know of a fix for this? > > > > > We're seeing a problem in the WMI Win32_OperatingSystem class. The > > > > LocalDateTime is reporting an hour ahead. Anything that uses this > > > > value is an hour off. (We first noticed it when our SCCM-based > > > > WakeOnLAN started waking computers up an hour early.) > > > > Thanks, looks like I'm not going crazy after all! Now I just have to > > > find a fix/patch to fix it. > > > ============ > > > If the class mentioned by RWW is behind this phenomenon then you > > > should be > > > able to reproduce it with the .vbs code below. Note that it reports > > > your > > > current time zone. If that number is incorrect then you will get > > > incorrect > > > results. You can probably check this with Microsoft's TimeZone > > > tool:http://www.microsoft.com/downloads/t...Id=07fb0bd8-f3.... > > > > Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2") > > > Set colItems = objWMIService.ExecQuery( _ > > > "SELECT * FROM Win32_OperatingSystem",,48) > > > For Each objItem In colItems > > > WScript.Echo "CurrentTimeZone: " & objItem.CurrentTimeZone > > > dtmLocalTime = objItem.LocalDateTime > > > dtmMonth = Mid(dtmLocalTime, 5, 2) > > > dtmDay = Mid(dtmLocalTime, 7, 2) > > > dtmYear = Left(dtmLocalTime, 4) > > > dtmHour = Mid(dtmLocalTime, 9, 2) > > > dtmMinutes = Mid(dtmLocalTime, 11, 2) > > > dtmSeconds = Mid(dtmLocalTime, 13, 2) > > > MsgBox "Time Zone=" & objItem.CurrentTimeZone & Chr(10) _ > > > & "Date=" & dtmMonth & "/" & dtmDay & "/" & dtmYear & Chr(10) _ > > > & "Time=" & dtmHour & ":" & dtmMinutes & ":" & dtmSeconds > > > Next > > > I should have included more detail on this. The weird part is that > > the timezone and DST values are correct, in both Win32_TimeZone and in > > Win32_OperatingSystem, but the LocalDateTime is an hour off. The time > > shows up correctly in the Windows GUI, but the LocalDateTime value > > doesn't match. Also, the time values in Win32_LocalTime are correct, > > but the LocalDateTime value in Win32_OperatingSystem doesn't match. > > Very strange. > > More details. The value that displays in in LocalDateTime (viewed > with WMI CIM Studio) includes "...GMT-04:00". We're in the US Eastern > Time Zone and just went from Daylight to Standard time. So, the > LocalDateTime value should include "...GMT-05:00". Everywhere > everywhere else I look has the 5-hour offset. I'm seeing this on both > Windows XP SP3 and Vista SP2. > > For what it's worth, the closest thing I've found that's similar to my > issue (thought not exactly) after extensive searching is this report > from back in > March:http://connect.microsoft.com/VisualS...back.aspx?...- > Hide quoted text - > > - Show quoted text - One more data point: I'm also seeing the same results in Windows 7. |
| |||
| Re: Time Error On Nov 5, 10:29*am, "Unknown" <unkn...@unknown.kom> wrote: > Did you visit *http://support.microsoft.com/gp/cp_dst*??? > > "Meanon" <mea...@telus.net> wrote in message > > news:3f574d3f-6a47-4b95-b793-c608d2582637@y28g2000prd.googlegroups.com... > On Nov 4, 2:06 pm, RWW-MCW <rth.wil...******.com> wrote: > > > > > > > On Nov 4, 4:48 pm, RWW-MCW <rth.wil...******.com> wrote: > > > > On Nov 4, 2:41 pm, "Pegasus [MVP]" <n...@microsoft.com> wrote: > > > > > "Meanon" <mea...@telus.net> wrote in message > > > > >news:fa091d4e-da36-4e7d-a066-0e6865ae386a@2g2000prl.googlegroups.com.... > > > > On Nov 4, 10:26 am, RWW-MCW <rth.wil...******.com> wrote: > > > > > > On Nov 2, 5:43 pm, Meanon <mea...@telus.net> wrote: > > > > > > > Since the time change on Sunday my WinXP Pro computer shows the > > > > > > right > > > > > > time in the Windows clock (in the system tray), but programs that > > > > > > use > > > > > > a function call to get the time from the operating system are 1 > > > > > > hour > > > > > > ahead. I recall something similar happened the last time the > > > > > > clocks > > > > > > changed. > > > > > > > Does anyone know of a fix for this? > > > > > > We're seeing a problem in the WMI Win32_OperatingSystem class. The > > > > > LocalDateTime is reporting an hour ahead. Anything that uses this > > > > > value is an hour off. (We first noticed it when our SCCM-based > > > > > WakeOnLAN started waking computers up an hour early.) > > > > > Thanks, looks like I'm not going crazy after all! Now I just have to > > > > find a fix/patch to fix it. > > > > ============ > > > > If the class mentioned by RWW is behind this phenomenon then you > > > > should be > > > > able to reproduce it with the .vbs code below. Note that it reports > > > > your > > > > current time zone. If that number is incorrect then you will get > > > > incorrect > > > > results. You can probably check this with Microsoft's TimeZone > > > > tool:http://www.microsoft.com/downloads/t...Id=07fb0bd8-f3.... > > > > > Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2") > > > > Set colItems = objWMIService.ExecQuery( _ > > > > "SELECT * FROM Win32_OperatingSystem",,48) > > > > For Each objItem In colItems > > > > WScript.Echo "CurrentTimeZone: " & objItem.CurrentTimeZone > > > > dtmLocalTime = objItem.LocalDateTime > > > > dtmMonth = Mid(dtmLocalTime, 5, 2) > > > > dtmDay = Mid(dtmLocalTime, 7, 2) > > > > dtmYear = Left(dtmLocalTime, 4) > > > > dtmHour = Mid(dtmLocalTime, 9, 2) > > > > dtmMinutes = Mid(dtmLocalTime, 11, 2) > > > > dtmSeconds = Mid(dtmLocalTime, 13, 2) > > > > MsgBox "Time Zone=" & objItem.CurrentTimeZone & Chr(10) _ > > > > & "Date=" & dtmMonth & "/" & dtmDay & "/" & dtmYear & Chr(10) _ > > > > & "Time=" & dtmHour & ":" & dtmMinutes & ":" & dtmSeconds > > > > Next > > > > I should have included more detail on this. The weird part is that > > > the timezone and DST values are correct, in both Win32_TimeZone and in > > > Win32_OperatingSystem, but the LocalDateTime is an hour off. The time > > > shows up correctly in the Windows GUI, but the LocalDateTime value > > > doesn't match. Also, the time values in Win32_LocalTime are correct, > > > but the LocalDateTime value in Win32_OperatingSystem doesn't match. > > > Very strange. > > > More details. The value that displays in in LocalDateTime (viewed > > with WMI CIM Studio) includes "...GMT-04:00". We're in the US Eastern > > Time Zone and just went from Daylight to Standard time. So, the > > LocalDateTime value should include "...GMT-05:00". Everywhere > > everywhere else I look has the 5-hour offset. I'm seeing this on both > > Windows XP SP3 and Vista SP2. > > > For what it's worth, the closest thing I've found that's similar to my > > issue (thought not exactly) after extensive searching is this report > > from back in > > March:http://connect.microsoft.com/VisualS...Feedback.aspx?... > > Hide quoted text - > > > - Show quoted text - > > One more data point: *I'm also seeing the same results in Windows 7.- Hide quoted text - > > - Show quoted text - Yes, but it doesn't address the proble. See RWW-MCW's reply above for an explanation of the problem. |
| |||
| Re: Time Error I have tested this on my home computer and my wife's work computer. The LocalDateTime is wrong on all of them. This must be a bug. Before posting a reply suggesting we check our DST settings or read more literature, please look at the LocalDateTime or run the script in my previous post on your PC(s). NOTE: To run the above script on Windows XP, you must remove or remark out the line with "OSArchitecture" near the beginning. I only included that kind of info for context. Last, I've also started a thread on the two MS Technet forums below. Windows XP SP3 http://social.technet.microsoft.com/...4-a79a90b68528 Vista Applications http://social.technet.microsoft.com/...8-66cff2827314 |
| Bookmarks |
| Thread Tools | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Error "System error 5 has occurred" trying to set the system time using NET TIME on XP | Spin | Windows XP | 3 | 05-29-2009 08:00 PM |
| Run time error | Annie | Internet Explorer | 0 | 03-29-2009 05:36 AM |
| Run-time error '50003': Unexpected error | skaizun | Windows Vista | 2 | 03-24-2009 07:35 AM |
| Run time error | Stuart | Internet Explorer | 2 | 01-07-2009 07:14 PM |
| Script Error While Loading Web page Then Run Time Error | Mooner | Windows XP | 2 | 12-16-2007 03:30 AM |
| New To Technology Questions? | Do You Need Help with Your Computer or Device? | Do You Need Help with this site? |