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:

  1. four digit year
  2. hyphen
  3. zero-padded month
  4. hyphen
  5. zero-padded day of month
  6. 't' character
  7. zero-padded hour
  8. ':' character
  9. zero-padded minute
  10. ':' character
  11. zero-padded second
  12. 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

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -