Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-9322] DateFormatter difference between macOS and Linux #3584

Closed
swift-ci opened this issue Nov 22, 2018 · 3 comments
Closed

[SR-9322] DateFormatter difference between macOS and Linux #3584

swift-ci opened this issue Nov 22, 2018 · 3 comments

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-9322
Radar None
Original Reporter alirp88 (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

root@a20f82436e13:/home# swift --version
Swift version 4.2.1 (swift-4.2.1-RELEASE)
Target: x86_64-unknown-linux-gnu

~ $ swift --version
Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)
Target: x86_64-apple-darwin18.2.0

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee None
Priority Medium

md5: 19e1d581e960e911730f788be222c4f1

Issue Description:

Hi

The following code on macOS and Linux (I used docker image swift:4.2 for my test) behave differently

import Foundation

let formatter: DateFormatter = {
    let formatter = DateFormatter()
    formatter.dateFormat = "yyyy-MM-dd"
    return formatter
}()

print(formatter.date(from: "2018-03-09T10:25:16+01:00"))

On macOS it prints `nil` and on Linux it prints `Optional(2018-03-09 00:00:00 +0000)`

@belkadan
Copy link

cc @millenomi

@spevans
Copy link
Collaborator

spevans commented Jan 15, 2019

#1822

@spevans
Copy link
Collaborator

spevans commented Feb 22, 2019

This is fixed in master and swift-5.0-branch

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants