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

DateFormatter.timeStyle == .none doesn't format Raw Date #5051

Open
zunda-pixel opened this issue Aug 5, 2024 · 1 comment
Open

DateFormatter.timeStyle == .none doesn't format Raw Date #5051

zunda-pixel opened this issue Aug 5, 2024 · 1 comment

Comments

@zunda-pixel
Copy link

DateFormatter.timeStyle == .none doesn't format Date

import Foundation

let dateString = "2024-07-31"
let formatter = DateFormatter()

formatter.dateStyle = .short
formatter.timeStyle = .none

print(formatter.date(from: dateString))

Result

macOS: 2024-07-30 15:00:00 +0000
Linux: nil

Expect

macOS: 2024-07-30 15:00:00 +0000
Linux: 2024-07-30 15:00:00 +0000
@LordBurtz
Copy link

LordBurtz commented Oct 2, 2024

just tested this, on macOS it returns nil aswell..

$ swift --version
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0

$ uname -a
Darwin JPXNGP6J95 23.6.0 Darwin Kernel Version 23.6.0: Wed Jul 31 20:48:52 PDT 2024; root:xnu-10063.141.1.700.5~1/RELEASE_ARM64_T6020 arm64

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

No branches or pull requests

2 participants