Closed tobinharris closed 10 years ago
I think it needs to be: yyyy-MM-dd'T'HH:mm:ss+ZZZZ
. Notice the '
around T. I'm not positive how to match that time zone format, but I'm sure it's possible. I would try all combinations of using z, Z, zzz, ZZZ, etc. (http://unicode.org/reports/tr35/tr35-10.html#Date_Format_Patterns).
Post what you learn here.
also, here are some common formats that it automatically tries to use: https://github.com/mysterioustrousers/MTDates/blob/master/MTDates/NSDate%2BMTDates.m#L124
Correct format for the string is yyyy-MM-dd'T'HH:mm:ssz
:
[NSDate mt_dateFromString:@"2013-09-27T14:12:14+01:00" usingFormat:@"yyyy-MM-dd'T'HH:mm:ssz"]; // 2013-09-27 13:12:14 +0000
z
is used for time zone format (i.e. +01:00
, -03:00
).
Thanks!
We are dealing with dates in the format 2013-09-27T14:12:14+01:00
I've tried to parse it using
...but no cigar.
Any help appreciated :)