ManagementDateTimeConverter.ToDateTime returns a local time
The DateTime value returned by ManagementDateTimeConverter.ToDateTime(String) is now based on the local time zone.
Version introduced
.NET 8 RC 1
Previous behavior
Previously, ManagementDateTimeConverter.ToDateTime(String) returned a value whose DateTime.Kind value was DateTimeKind.Unspecified.
New behavior
Starting in .NET 8, ManagementDateTimeConverter.ToDateTime(String) returns a value whose DateTime.Kind value was DateTimeKind.Local.
Type of breaking change
This change is a behavioral change.
Reason for change
This change was made so that the code matched what the documentation said it did.
Recommended action
If your code expected the returned value to be based on an unspecified time zone, update it to expect a value that's based on the local time zone.
Affected APIs
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for