Skip to content

SWbemDateTime.UTC may return values outside the range of -720 to 720 without error#2159

Open
BozhanL wants to merge 1 commit into
MicrosoftDocs:docsfrom
BozhanL:docs
Open

SWbemDateTime.UTC may return values outside the range of -720 to 720 without error#2159
BozhanL wants to merge 1 commit into
MicrosoftDocs:docsfrom
BozhanL:docs

Conversation

@BozhanL
Copy link
Copy Markdown

@BozhanL BozhanL commented Feb 13, 2026

Run the following vbs in New Zealand timezone on Windows 11.

Set dateTime = CreateObject("WbemScripting.SWbemDateTime")
dateTime.SetVarDate Now
Wscript.Echo dateTime
Wscript.Echo dateTime.UTC

Output:

20260213135921.000000+780
780

Test with high offset.

Set dateTime = CreateObject("WbemScripting.SWbemDateTime")
dateTime.Value = "20260213024238.000000+900"
Wscript.Echo dateTime
Wscript.Echo dateTime.UTC

Output:

20260213024238.000000+900
900

Copilot AI review requested due to automatic review settings February 13, 2026 01:05
@prmerger-automator
Copy link
Copy Markdown
Contributor

@BozhanL : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change.

Copy link
Copy Markdown
Contributor

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

This PR updates the documentation for SWbemDateTime.UTC to reflect observed behavior where reading the property can return timezone offsets outside the documented -720..720 range without raising an error.

Changes:

  • Clarifies that the -720..720 range is enforced on writes, while reads may return values outside the range.
  • Updates the “Error codes” section wording to scope errors to setting the UTC property.

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

Comment thread desktop-src/WmiSdk/swbemdatetime-utc.md Outdated
Comment thread desktop-src/WmiSdk/swbemdatetime-utc.md
* Property may return values outside the range of -720 to 720 without error
@stevewhims
Copy link
Copy Markdown
Member

I don't have perms to merge this. Am investigating getting them back.

@BozhanL
Copy link
Copy Markdown
Author

BozhanL commented Feb 24, 2026

Hi, any updates on this? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants