Friday, May 3, 2013

NSTimeZone localizedName example ios


localizedName :locale:

Returns the name of the receiver localized for a given locale.
- (NSString *)localizedName:(NSTimeZoneNameStyle)style locale:(NSLocale*)locale
Parameters
style
The format style for the returned string.
locale
The locale for which to format the name.
Return Value of [NSTimeZone localizedName]
The name of the receiver localized for locale using style.
Example of [NSTimeZone localizedName]
NSTimeZone *systimeZone = [NSTimeZone systemTimeZone];
NSString *timeZoneString = [systimeZone localizedName:NSTimeZoneNameStyleShortStandard locale:currentLocale];
if([systimeZone isDaylightSavingTimeForDate:[NSDate date]]){
    timeZoneString = [systimeZone localizedName:NSTimeZoneNameStyleShortDaylightSaving locale:currentLocale];
}