How can I convert the date string calculated by CoreData to ISO format YYYY-MM-DD HH:MM:SS +000?
I have a string like this, 285298171.84336197376251220703
and I know it's created by CoreData and I want to find a way to convert it into ISO format, can anyone help me?
Thanks in advance.
Added: actually this is in an XML file which an application created. 285298171.84336197376251220703 开发者_运维技巧281021264.12619298696517944336
Without more context, it's impossible to be sure, but you're almost certainly observing a string-ified NSTimeInterval
(a typedef
'd double
) that represents the number of seconds since a reference date. You want the uderlying NSDate
that it represents which you can convert to any standard string format via NSDateFormatter
.
精彩评论