You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the ISO8601 date parser, ISO8601DateFormatter.date(from:) parses an ISO8601 date string into a Date.
The parsing strategy correctly handles the timezone offset, but this information is then lost, because Date itself is not timezone aware:
import Foundation
letdateString="2024-10-08T08:12:34-08:00"letdate=ISO8601DateFormatter().date(from: dateString)! // timezone offset lost
There are use cases that would like to parse such a string and also know what timezone the date was formatted in. It would be great to have API for returning a timezone-aware value, or even just to return the offset alongside the Date.
The text was updated successfully, but these errors were encountered:
Currently, the ISO8601 date parser,
ISO8601DateFormatter.date(from:)
parses an ISO8601 date string into aDate
.The parsing strategy correctly handles the timezone offset, but this information is then lost, because
Date
itself is not timezone aware:There are use cases that would like to parse such a string and also know what timezone the date was formatted in. It would be great to have API for returning a timezone-aware value, or even just to return the offset alongside the
Date
.The text was updated successfully, but these errors were encountered: