Skip to content

Fix invalid datetime UTC offset error in some pacific timezone#2

Merged
mxk merged 1 commit intomxk:mainfrom
BozhanL:main
Mar 4, 2026
Merged

Fix invalid datetime UTC offset error in some pacific timezone#2
mxk merged 1 commit intomxk:mainfrom
BozhanL:main

Conversation

@BozhanL
Copy link
Contributor

@BozhanL BozhanL commented Feb 12, 2026

It's possible to have offsets greater than 720 in some countries. Currently, the offset for New Zealand is 780, and it seems that the offset for the Line Islands is 840.

Copilot AI review requested due to automatic review settings February 12, 2026 13:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts WMI CIM datetime parsing to support Pacific timezones with UTC offsets beyond +12:00 (e.g., UTC+14:00), preventing “invalid datetime UTC offset” errors when parsing valid WMI timestamps.

Changes:

  • Expand accepted positive UTC offset range from +720 to +840 minutes in parseDateTime.
  • Add a unit test covering parsing of a +840 (UTC+14) offset datetime string.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
wmi.go Updates parseDateTime to allow UTC offsets up to +840 minutes (UTC+14).
wmi_test.go Adds a regression test validating parsing and localization behavior for a +840 offset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mxk
Copy link
Owner

mxk commented Feb 12, 2026

Thanks! I’m currently away on vacation and will be back in two weeks. I’ll take a look then.

@BozhanL
Copy link
Contributor Author

BozhanL commented Feb 28, 2026

MicrosoftDocs/win32#2159

@mxk mxk merged commit 70b57f1 into mxk:main Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants