• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Need localization-proof method of transporting dates.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need localization-proof method of transporting dates.


  • Subject: Re: Need localization-proof method of transporting dates.
  • From: Graham Cox <email@hidden>
  • Date: Wed, 8 Apr 2009 14:11:36 +1000


On 08/04/2009, at 1:54 PM, Michael Ash wrote:

If this is also how you store your dates then this is fine. If you
store them in some other way (e.g. asking the system to put them in an
plist) then this is still fine as long as you're using whole numbers
of seconds. If you can store arbitrary fractional values of seconds in
your dates, and you store them in some other way than the above, then
I would be wary: floating point math is inexact, and it's possible
that the conversion to and from the intermediate representation could
end up with a different least-significant bit.

Note that if you manually convert your date to the serialized
representation but it's not the above, then you could simply hash that
intermediate representation directly.


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.

--Graham


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Need localization-proof method of transporting dates.
      • From: Michael Ash <email@hidden>
References: 
 >Need localization-proof method of transporting dates. (From: Graham Cox <email@hidden>)
 >Re: Need localization-proof method of transporting dates. (From: Christopher Kane <email@hidden>)
 >Re: Need localization-proof method of transporting dates. (From: Graham Cox <email@hidden>)
 >Re: Need localization-proof method of transporting dates. (From: Michael Ash <email@hidden>)

  • Prev by Date: Re: finder file size
  • Next by Date: Re: Need localization-proof method of transporting dates.
  • Previous by thread: Re: Need localization-proof method of transporting dates.
  • Next by thread: Re: Need localization-proof method of transporting dates.
  • Index(es):
    • Date
    • Thread