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
SR-13218 Swift's ISO8601DateFormatter doesn't parse all valid RFC3339 dates
Issue Description:
See the attached test.swift file, which (correctly) prints "Optional(2013-11-01 00:00:00 +0000)" on macOS 10.14 and macOS 10.15, but prints "nil" on Linux.
Since the test program is so short, I'll also include it here:
Unfortunately, I currently do not have a fully debuggable environment set up on Linux, but only caught this problem through a unit test (I'm developing on macOS).
The unit test includes a lot of other date strings that are all parsed correctly, but this particular one always evaluates to nil.
The text was updated successfully, but these errors were encountered:
$ for f in 5.0 5.1 5.2 master; do jw-docker-swift-$f swift date.swift; done
nil
nil
nil
nil
$ swift date.swift ## macOS
Optional(2013-11-01 12:00:00 am +0000)
Testing with corelibs-foundation on macOS it does actually work so I suspect this is a difference between Apple's ICU fork and regular ICU. The decimal point seems to be the actual issue so it might be possible to do a work around. However dates ending in a .00Z format don't not seem to be officially supported according to the list https://developer.apple.com/documentation/foundation/iso8601dateformatter/1643324-formatoptions
Attachment: Download
Environment
Swift 5.1.3
Date: December 13, 2019
Tag: swift-5.1.3-RELEASE
on Ubuntu 18.04
Additional Detail from JIRA
md5: 2edc9a53797eff6716707dfa50f8b190
relates to:
Issue Description:
See the attached test.swift file, which (correctly) prints "Optional(2013-11-01 00:00:00 +0000)" on macOS 10.14 and macOS 10.15, but prints "nil" on Linux.
Since the test program is so short, I'll also include it here:
Unfortunately, I currently do not have a fully debuggable environment set up on Linux, but only caught this problem through a unit test (I'm developing on macOS).
The unit test includes a lot of other date strings that are all parsed correctly, but this particular one always evaluates to nil.
The text was updated successfully, but these errors were encountered: