开发者

How can I convert the date string calculated by CoreData to ISO format YYYY-MM-DD HH:MM:SS +000?

开发者 https://www.devze.com 2022-12-20 04:41 出处:网络
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?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消