• 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: NSCalendarDate saving and loading to get the same date-time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCalendarDate saving and loading to get the same date-time


  • Subject: Re: NSCalendarDate saving and loading to get the same date-time
  • From: Uli Kusterer <email@hidden>
  • Date: Mon, 9 Oct 2006 21:41:45 +0200


Am 09.10.2006 um 21:28 schrieb Sarat Kongara:
I have a NSDictionary with a couple of NSCalendarDate objects as
values, I save and load the dictionary to a plist file (using
NSDictionary writeToFile... and NSDictionary
dictionaryWithContentsOfURL... methods).

Say I set the date-time to Oct 9th, 2006 10:30 AM (My timezone is set
to New York in System Preferences) and save the dictionary. I change
my timezone to San Francisco (In System Preferences) and  load the
dictionary the date-time is Oct 9th, 2006 7:30 AM.

Is there a way to make sure the date-time is the same value (same
mm-dd-yyyy hh:mm:ss ) after save and load even if the timezone is
changed.

Save the time zone relative to which you specified your time and restore it later, or query the OS for the time difference and save that along with the date so you can adjust for it?


It *is* the exact same time, just expressed in another time zone (i.e. when it's 2:30 in the US, it's about 11:30 in central Europe). The time zone doesn't change the date, it changes how it is displayed. So none of the things you observed is in any way surprising.

Cheers,
-- M. Uli Kusterer
http://www.zathras.de


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Re: NSCalendarDate saving and loading to get the same date-time
      • From: "Sarat Kongara" <email@hidden>
References: 
 >NSCalendarDate saving and loading to get the same date-time (From: "Sarat Kongara" <email@hidden>)

  • Prev by Date: Re: NSCalendarDate saving and loading to get the same date-time
  • Next by Date: Re: Re: NSCalendarDate saving and loading to get the same date-time
  • Previous by thread: Re: Re: NSCalendarDate saving and loading to get the same date-time
  • Next by thread: Re: Re: NSCalendarDate saving and loading to get the same date-time
  • Index(es):
    • Date
    • Thread