views:

39

answers:

2

Is it possible to get current time of other cities from code?(for example current time of Paris)

A: 

Look at NSTimeZone.

Joseph Tura
+3  A: 

Here is how to get it:

[NSTimeZone setDefaultTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"CEST"]];
NSLog(@"Paris time: %@", [[NSDate date] descriptionWithLocale:nil ]);
Paul Ardeleanu
A list of timezone abbreviations is available here: http://www.timeanddate.com/library/abbreviations/timezones/
Paul Ardeleanu
@Paul Ardeleanu and NSTimeZone supports 48 out of those 250 abbreviations.
fluchtpunkt