On Wed, Apr 8, 2009 at 12:11 AM, Graham Cox <graham....@bigpond.com> wrote: > Well, the date itself is stored in the archive using standard archiving. I'm > not sure how it writes itself - so should I be worried? I thought I could > rely on archiving/dearchiving accurately giving me back whatever I stored > though in this case there could be a tiny change. > > The date comes from a NSDatePicker control, which is set to have 1 minute > resolution (which is still more than I need, 1 day res would be fine, > haven't looked into whether there's a way to lose the time part in the > control). I can certainly pre-process the received date to truncate it to a > whole minute or even a whole day. I should probably do this to make sure.
I got curious and experimented. Archiving (as in NSCoder) appears to work fine, but if you send an NSDate through an XML plist, it loses its fractional seconds! (rdar://6768646) So if you're using plist serialization, you may well not get the same date out that you put in. However, since it sounds like you'll always get a whole number of seconds (a multiple of 60, for that matter) then you should be fine. Explicitly rounding on your side of things certainly wouldn't hurt either. Mike _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com