-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Initial NSDateFormatter tests #274
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
Conversation
@swift-ci please test |
Thanks, always great to have more tests in place. |
Glad to help! |
lgtm |
wonder if this would prove to be useful for the person who made http://nsdateformatter.com |
Good question, I saw that yesterday and thought it would be helpful for me. |
func test_dateStyleFull() { | ||
|
||
let timestamps = [ | ||
-31536000 : "Wednesday, January 1, 1969 at 12:00:00 AM GMT" , 0.0 : "Thursday, January 1, 1970 at 12:00:00 AM GMT", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the correct value be Greenwich Mean Time
instead of GMT
?
That's what ICU spec says (http://userguide.icu-project.org/formatparse/datetime)
Also, that's the behaviour of f.timeStyle = .full
on macOS.
It appears that for negative timestampts (e.g. -31536000) DateFormatter on macOS wrongly returns GMT instead of Greenwich Mean Time, which seems to be a bug.
This PR primarily contains tests, but I also added CF attribute setters. I tried to use a wide variety of dates, but more could be added in the future.
More
NSDateFormatter
work coming in future pull requests.