I would like to format a date string into a NSDate object, which doesn't sound like a big thing.
The point is, that the date string contains a dot in the timezone value instead of a plus or something else. A date looks like this:
2017-06-04T16:00:00.000Z
I tried format strings like
yyyy-MM-dd'T'HH:mm:ss.ZZZZ
yyyy-MM-dd'T'HH:mm:ss.ZZZ
yyyy-MM-dd'T'HH:mm:ss.Z
Of course I've also checked it on nsdateformatter.com, which works but in xCode the NSDate is always nil.
yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
??Z
. That's the timezone. When you quote that, the string gets interpreted in local time unless a specific timezone is set on the date formatter. If you don't quote theZ
there is no need to set a specific timezone on the formatter and the string gets interpreted properly.Z
actually? do you have any reference that I can read into?