I am using this code to create timezone stamps for the server interaction.
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
NSLocale *enUSPOSIXLocale = [NSLocale localeWithLocaleIdentifier:@"en_US_POSIX"];
//This NSDateFormatter will return timezone in format "UTC+XX:XX"
NSString *formattedTimeZone = [dateFormatter stringFromDate:[NSDate date]];
There's no formatting problem here - or at least, no bug in
NSDateFormatter. It's behaving exactly as documented. From Unicode TR35-31, for 'Z' repeated 5 times:
The ISO8601 extended format with hours, minutes and optional seconds fields. The ISO8601 UTC indicator "Z" is used when local time offset is 0. This is equivalent to the "XXXXX" specifier.
If you really, really want to avoid the Z, it looks like you should use
xxxxx, documented as:
The ISO8601 extended format with hours, minutes and optional seconds fields. (The same as XXXXX, minus "Z".)
Note that if you only ever want hours and minutes, never seconds, you should use
xxx instead. It's unlikely to make any difference for time zones in modern times - sub-minute offsets were phased out a long time ago.