开发者

What is the range for the DATE type in Core Data?

开发者 https://www.devze.com 2022-12-12 14:15 出处:网络
I\'m putting together an application that will require the recording of dates as far back as the BC range; can Core Data\'s date type handle this, or do I need to define another entity to properly rec

I'm putting together an application that will require the recording of dates as far back as the BC range; can Core Data's date type handle this, or do I need to define another entity to properly record and 开发者_运维技巧format dates?


NSDate works using NSTimeInterval which is a double.

always specified in seconds; it yields sub-millisecond precision over a range of 10,000 years.

I'm not going to work out how far back in time a double will go (order of +/- 10^300 seconds or so), but I think you will be safe to use it for the BC ranges. For example: 1,000 years is about 3x10^11 seconds.


Perhaps this is useful, NSDate distantPast gives you:

0001-12-31 19:43:12 -041648

and NSDate distantFuture gives you:

4000-12-31 21:00:00 -0300
0

精彩评论

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

关注公众号