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

ISO8601 Format issue #165

Closed
HEYGUL opened this issue Feb 23, 2016 · 3 comments
Closed

ISO8601 Format issue #165

HEYGUL opened this issue Feb 23, 2016 · 3 comments

Comments

@HEYGUL
Copy link

HEYGUL commented Feb 23, 2016

I am experiencing issues when using SwiftDate built-in functions to serialize/deserialize dates from server in ISO8601 format.
example date from server:
"2016-06-06T08:30:00+02:00"

Changing date format from "yyyy-MM-dd'T'HH:mm:ss:SSSS" to "yyyy-MM-dd'T'HH:mm:ssZZZZZ"fixes the issue

@malcommac
Copy link
Owner

Regarding deserialization from string you should not have problems; for example

let d = "2016-06-06T08:30:00+02:00".toDate(DateFormat.ISO8601)

output NSDate is
2016-06-06 06:30:00 +0000
which is correct.

About serialization this is a known issue; it should be fixed in develop branch (https://github.com/malcommac/SwiftDate/blob/develop/Sources/SwiftDate/NSDateFormatter%2BSwiftDate.swift#L78) and soon as we ready with relative date formatting it will be published.

@Hout
Copy link
Contributor

Hout commented Feb 25, 2016

Is this issue resolved now?

@malcommac
Copy link
Owner

Yes we can close it

@Hout Hout closed this as completed Feb 25, 2016
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

3 participants