NSDate
value is returned by CloudKit
. Which representation will system choose, when I am storing date in Core Data as NSTimeInterval
? I know NSTimeInterval
stores number of seconds since some specific reference date. But which reference date will be choosen here?
mo.setValue(record.creationDate, forKey: "creationDate")
Latter on I have to compare this date with current date, so I have to convert it back to NSDate
, so I have to use one of the NSDate timeIntervalSinceXXX
methods.
I have found this in docs:
Dates and Times NSManagedObject represents date attributes using NSDate objects, and stores times internally as an NSTimeInterval value since the reference date (which has a time zone of GMT). Time zones are not explicitly stored—indeed you should always represent a Core Data date attribute in GMT, this way searches are normalized in the database. If you need to preserve the time zone information, you need to store a time zone attribute in your model. This may again require you to create a subclass of NSManagedObject.
I does not say anything what is the reference