• 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: NSTimestamp mapped to DATE for mysql
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTimestamp mapped to DATE for mysql


  • Subject: Re: NSTimestamp mapped to DATE for mysql
  • From: John Pollard <email@hidden>
  • Date: Fri, 18 Jan 2008 10:28:26 +0000

Hi Lachlan,


On 18 Jan 2008, at 03:35, Lachlan Deck wrote:

Hi John,

On 18/01/2008, at 2:44 AM, John Pollard wrote:

Many thanks for your reply. I do do all the default timezone setting in my application, client and server side. However, I found SimpleDateTimes used for conversions don't use the system timezone and you also have to set it on these explicitly. I currently set it to London/Europe.

When my code uses GMT, the date range query looks better as no hour is added for BST as you said. However, once the query RESULT data gets back to my WO Java Client app, the NSTimestamps have lost an hour and hence flip to the previous day.

Yep, and that's because the time is getting truncated in your database field because you're storing dates rather than datetimes. Is that right?

I wouldn't expect this when using GMT because there should be no time shifting? Shouldn't the dates go in with no time component and come out the same, whether during a BST period or not?




When I view the Date & Time panel in System Preferences, the Time Zone says GMT (and can't be changed), which would seem to be correct.

? In your mac Sys prefs? You'll have to click the Lock image, provide your password etc...

Even when unlocked. I can pick a Closest City only within GMT. I am an administrator.




Using Europe/London as the timezone works when using mysql 5.0.18 but breaks as described below in the latest 5.0.45. When using this, the hour is shifted in queries sent to the DB, but using mysql 5.0.18, the right results come back.

Strange. I wouldn't have expected it to work in the past given the above assumption about your storage of dates. (Except that maybe now you're in daylight saving time?)

It is ok for querying dates around now, but queries of dates from last summer break as described above, only in 5.0.45. I had to put our live database back to 5.0.18 so it currently works ok. This really gets me, that something has changed between versions of mysql apparently.


I think using GMT is my most likely route to success, I just have to work out why dates with no time coming off the database then appear with a time in my app.



I have tried several things including loading the /usr/share/ zoneinfo Mac system timezone info into mysql and setting the timezone to be GMT (which is one of those that gets loaded).

Also ensure that your EOModel doesn't having a timezone setting on the field.

Couldn't find anything recursively grepping my model project.



Just some more random thoughts...

Very nice of you to take the time.

John
_______________________________________________
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


  • Follow-Ups:
    • Re: NSTimestamp mapped to DATE for mysql
      • From: Lachlan Deck <email@hidden>
References: 
 >Re: NSTimestamp mapped to DATE for mysql (From: John Pollard <email@hidden>)
 >Re: NSTimestamp mapped to DATE for mysql (From: Lachlan Deck <email@hidden>)

  • Prev by Date: Re: How do I prevent WO5.4 from reading the whole request?
  • Next by Date: Re: WO5.4 DTW NSMutableArray ClassCastException
  • Previous by thread: Re: NSTimestamp mapped to DATE for mysql
  • Next by thread: Re: NSTimestamp mapped to DATE for mysql
  • Index(es):
    • Date
    • Thread