Re: Time zone problem with CoreData
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