ios - MagicalRecord date parsing -
i've got date in following format:
2013-05-04t05:07:09+00:00
i'm using magicalrecord map nsdate automatically. far can see above date format should comply magicalrecord's default date format: yyyy-mm-dd't'hh:mm:ss'z'.
i have tried custom dateformat entry in attribute's user info (see this article):
yyyy-mm-ddthh:mm:ss+z, yyyy-mm-dd t hh:mm:ss z, yyyy-mm-dd't'hh:mm:ss'+'z
but none of them work in order have parse date , returns nil regardless of setting custom dateformat or using magicalrecord's default format.
let's @ string:
2013-05-04t05:07:09+00:00 this is:
- four digit year
- hyphen
- zero-padded month
- hyphen
- zero-padded day of month
- 't' character
- zero-padded hour
- ':' character
- zero-padded minute
- ':' character
- zero-padded second
- timezone (with direction gmt , separating colon)
thus, according the date format specifiers documentation, pattern you'd want is:
yyyy-mm-dd't'hh:mm:sszzzzz also, sure use en_us_posix locale nsdateformatter.
Comments
Post a Comment