Skip to content

Conversation

@peombwa
Copy link
Member

@peombwa peombwa commented Jan 5, 2022

This PR applies a custom directive that:

  • Changes XmlDateTimeSerializationMode in AutoREST's string to DateTime method from Unspecified to Utc. This ensures that date-time strings are always converted to UTC and not local time.
  • Ensures DateTime properties are always serialized in UTC in AutoREST.PowerShell's .ToJson method.

e.g.,

  • 2021-11-11T19:58:15.511Z -> 2021-11-11T19:58:15.5110000Z
  • 2021-11-11T19:58:15.511+08:00 -> 2021-11-11T11:58:15.5110000Z
  • [datetime]::Parse("2021-11-11T19:58:15.511Z") -> 2021-11-11T19:58:15.5110000Z
  • [datetime]::Parse("2021-11-11T19:58:15.511Z").ToUniversalTime() -> 2021-11-11T19:58:15.5110000Z

Closes #901
Closes #962

DateTimeOffset support will be added by Azure/autorest.powershell#584.

@peombwa peombwa requested a review from timayabi2020 as a code owner January 6, 2022 19:33
@peombwa peombwa merged commit a9b5989 into dev Jan 6, 2022
@peombwa peombwa deleted the bugfixes/serializeDatesToUTC branch January 6, 2022 23:03
@peombwa peombwa mentioned this pull request Jan 19, 2022
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.

New-MgTeamChannelMessage : Invalid request body was sent. New-MgEntitlementManagementAccessPackageAssignmentRequest StartDate timezone error

3 participants