I had to convert times from Windows to iOS on a prior project. We finally settled on an around-the-world solution which geolocated our target location, called a web service (geonames.org) to retrieve the TZ database name for that location, and then built the NSTimeZone structure calling [NSTimeZone timeZoneWithName:] using the TZ database name.
Most operating systems use the TZ database for managing time zones. The TZ database has a single, unambiguous name for each locale in the fashion "america/chicago". Windows uses their own format which requires you to know if the locale is observing daylight savings time (i.e. "central standard time" vs "central daylight time"). This is a real problem .. a problem that TZ database solves for you. Too bad Microsoft didn't see it that way. On Wed, Jan 18, 2012 at 9:30 AM, Dixon Data <i...@dixondata.com> wrote: > I had to convert times from Windows to iOS on a prior project. We finally > settled on an around-the-world solution which geolocated our target > location, called a web service (geonames.org) to retrieve the TZ database > name for that location, and then built the NSTimeZone structure calling > [NSTimeZone timeZoneWithName:] using the TZ database name. > > Most operating systems use the TZ database for managing time zones. The TZ > database has a single, unambiguous name for each locale in the fashion > "america/chicago". Windows uses their own format which requires you to know > if the locale is observing daylight savings time (i.e. "central standard > time" vs "central daylight time"). This is a real problem .. a problem that > TZ database solves for you. Too bad Microsoft didn't see it that way. > > On Tue, Jan 17, 2012 at 11:49 PM, Appa Rao Mulpuri < > appar...@ivycomptech.com> wrote: > >> Hi List, >> >> Quick question related to Time zones. >> >> I want to get the Time zone standard name for the particular timezone. I >> have used following code base to get the string, which is working perfect. >> >> >> >> NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]; >> >> NSString *timeZoneId = [timeZone >> localizedName:NSTimeZoneNameStyleStandard locale:locale]; >> >> >> Problem is I want to get the same string which windows is returning. From >> http://msdn.microsoft.com/en-us/library/ms912391(v=winembedded.11).aspx, >> for suppose if user selects GMT+3:00, it should return 'Arabic Standard >> Time'. Is there any provision in Mac to get the same string for the GMT >> values? >> >> >> >> Thanks, >> >> - Apparao Mulpuri >> >> This email and any attachments are confidential, and may be legally >> privileged and protected by copyright. If you are not the intended >> recipient dissemination or copying of this email is prohibited. If you have >> received this in error, please notify the sender by replying by email and >> then delete the email completely from your system. Any views or opinions >> are solely those of the sender. This communication is not intended to form >> a binding contract unless expressly indicated to the contrary and properly >> authorised. Any actions taken on the basis of this email are at the >> recipient's own risk. >> >> >> This email is sent for and on behalf of Ivy Comptech Private Limited. Ivy >> Comptech Private Limited is a limited liability company. >> >> This email and any attachments are confidential, and may be legally >> privileged and protected by copyright. If you are not the intended >> recipient dissemination or copying of this email is prohibited. If you have >> received this in error, please notify the sender by replying by email and >> then delete the email completely from your system. >> Any views or opinions are solely those of the sender. This communication >> is not intended to form a binding contract on behalf of Ivy Comptech >> Private Limited unless expressly indicated to the contrary and properly >> authorised. Any actions taken on the basis of this email are at the >> recipient's own risk. >> >> Registered office: >> Ivy Comptech Private Limited, Cyber Spazio, Road No. 2, Banjara Hills, >> Hyderabad 500 033, Andhra Pradesh, India. Registered number: 37994. >> Registered in India. A list of members' names is available for inspection >> at the registered office. >> >> _______________________________________________ >> >> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) >> >> 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: >> http://lists.apple.com/mailman/options/cocoa-dev/spam%40dixondata.com >> >> This email sent to s...@dixondata.com >> > > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com