• 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: Time zone problem with CoreData
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Time zone problem with CoreData


  • Subject: Re: Time zone problem with CoreData
  • From: Nick Zitzmann <email@hidden>
  • Date: Mon, 11 Feb 2008 18:25:55 -0700


On Feb 11, 2008 AD, at 6:15 PM, Kevin Hoctor wrote:

The problem is that when the dates are retrieved, they are coming in with a local time zone causing the date to show as yesterday. It doesn't matter that I'm displaying the dates with a GMT time zone, the actual value from (NSDate *)date has the time zone.

I don't even want the time. What is the correct way to keep time zones out of the equation with CoreData?


CoreData uses NSDate, not NSCalendarDate. Unlike NSCalendarDate, NSDate does not support encapsulating time zones. If you need a date that encapsulates a time zone, then you will need to store something that identifies the time zone somewhere else (if that's important), and when you retrieve the date, then you can turn it into an NSCalendarDate and reload the time zone.

Nick Zitzmann
<http://www.chronosnet.com/>

_______________________________________________

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


References: 
 >Time zone problem with CoreData (From: Kevin Hoctor <email@hidden>)

  • Prev by Date: UPDATE: Core Data Cascade delete rule sometimes doesn't -- maybe never? (all of a sudden)
  • Next by Date: Re: nspopupbuttoncell attribs
  • Previous by thread: Time zone problem with CoreData
  • Next by thread: UPDATE: Core Data Cascade delete rule sometimes doesn't -- maybe never? (all of a sudden)
  • Index(es):
    • Date
    • Thread