• 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: Need localization-proof method of transporting dates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need localization-proof method of transporting dates


  • Subject: Re: Need localization-proof method of transporting dates
  • From: Peter Hudson <email@hidden>
  • Date: Sun, 05 Apr 2009 00:18:34 +0100

When you collect your date from the date picker, are you setting the time in the date picker as well as the date ?

I used a date picker - setting dd/mm/yy only - and found it producing date objects bearing unexpeced times of the given day.
Naturally, these produced interesting results as they travelled around the world...


To fix this aspect of my problem, I collected the date from the picker and created a new date object using a specific time ( in this case 12:00 )

The other part of the fix was to set the application to run in a given time zone ( in my case GMT was convenient )

[NSTimeZone  setDefaultTimeZone:[NSTimeZone timeZoneWithName:@"GMT"]];

All you then need to do is to tell your users that expiry will occur at a given time in the time zone you set - leaving them to determine the local time at which it will occur.

PGJH
_______________________________________________

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


  • Prev by Date: Re: memory deallocation
  • Next by Date: Re: IB Plugin help
  • Previous by thread: Re: memory deallocation
  • Next by thread: Automating reading classes with InterfaceBuilder
  • Index(es):
    • Date
    • Thread