• 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: Recording and looking up dates, when day-wide precision is required
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recording and looking up dates, when day-wide precision is required


  • Subject: Re: Recording and looking up dates, when day-wide precision is required
  • From: Lachlan Deck <email@hidden>
  • Date: Wed, 24 Dec 2008 09:22:26 +1100

On 24/12/2008, at 9:08 AM, Lachlan Deck wrote:

On 24/12/2008, at 1:48 AM, Florijan Stamenkovic wrote:

One more thing... Reading the posts that David mentioned, I notice there is some mentioning of java.util.Date being converted to and from NSTimestamp. I am not sure why this is mentioned as a problem. AFAIK, both Date and NSTimestamp (which inherits from Date) record the amount of milliseconds that passed from January 1, 1970, 00:00:00 GMT. Conversion should be lossless, no? Or, is this a problem for some other reason?

NSTimestamps understand timezones *only* during construction. From that point on they are strictly UTC. i.e., they do not preserve the timezone from which they were constructed. You'll need another column, as mentioned above, to store that information.

To clarify, yes it is lossless insofar as date.getTime() == timestamp.getTime() where
Date date = new Date()
NSTimestamp timestamp = new NSTimestamp(date);


However, date.getTimeZoneOffset() != timestamp.getTimeZoneOffset() unless date was in GMT/UTC.

with regards,
--

Lachlan Deck

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Recording and looking up dates, when day-wide precision is required (From: Florijan Stamenkovic <email@hidden>)
 >Re: Recording and looking up dates, when day-wide precision is required (From: Lachlan Deck <email@hidden>)
 >Re: Recording and looking up dates, when day-wide precision is required (From: Florijan Stamenkovic <email@hidden>)
 >Re: Recording and looking up dates, when day-wide precision is required (From: Lachlan Deck <email@hidden>)

  • Prev by Date: Re: Recording and looking up dates, when day-wide precision is required
  • Next by Date: Who's NSDelayedCallbackCenter and why is he retaining a huge load of junk?
  • Previous by thread: Re: Recording and looking up dates, when day-wide precision is required
  • Next by thread: Re: Recording and looking up dates, when day-wide precision is required
  • Index(es):
    • Date
    • Thread