• 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: Date-Only NSTimestamps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date-Only NSTimestamps


  • Subject: Re: Date-Only NSTimestamps
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 2 Jan 2008 20:20:18 -0800


On Jan 2, 2008, at 1:51 PM, Simon McLean wrote:

It should be possible to normalize it at 12:00 GMT instead of the default time zone. I need to try that out.


IIRC all timestamps are stored at GMT.

Yes.


So if you do this on an object:

setCreateTimeStamp(new NSTimestamp());

at 01 Jan 08 00:01 on a server that is at BST then it get's stored as 31 Dec 08 23:01 GMT

Yes, it is the conversion to / from the local time zone where things get odd.



So if you then query using a qualifier to find things created after 01 Jan 08 00:00 at GMT, you miss this object.

The qualifier values are also subject to this same conversion. It is a problem when the value is saved during DST and then queried when DST is not in effect (or vice versa).



Working at GMT is definitely one way of easing the pain, but i think everything has to be at GMT for it to work - which i guess is most easily accomplished by setting the default time time zone to GMT. But then you get a whole new world of pain because you have to convert timestamps on the fly for presenting to your users!

I am not convinced that this will solve anything. That is what WO is doing already. The problem is that we really want less accuracy than Java provides. we want to ignore things like DST. I think the only thing that will work is to format the dates to / from GMT. That is when the user types in 2PM parse it as if it is 2PM GMT not 2PM in the local time zone. I think this will work, but not if your app is used by people in more than one time zone. If it is used in more than one time zone, well, its just hard.



I work in the travel industry and hence date/time stuff is pretty interesting (eg flights taking off in one time zone and landing 2 days later in another timezone, or presenting a hotel cancellation policy stored in one timezone to a user in another timezone so they know when they need to cancel it by locally).

That is a hell that I would not wish on myself.

Chuck

--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






_______________________________________________
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: 
 >Date-Only NSTimestamps (From: David Avendasora <email@hidden>)
 >Re: Date-Only NSTimestamps (From: Chuck Hill <email@hidden>)
 >Re: Date-Only NSTimestamps (From: Simon McLean <email@hidden>)
 >Re: Date-Only NSTimestamps (From: Chuck Hill <email@hidden>)
 >Re: Date-Only NSTimestamps (From: Simon McLean <email@hidden>)

  • Prev by Date: Re: Date-Only NSTimestamps
  • Next by Date: Re: Date-Only NSTimestamps
  • Previous by thread: Re: Date-Only NSTimestamps
  • Next by thread: Re: Date-Only NSTimestamps
  • Index(es):
    • Date
    • Thread