So I'm trying to get the time of a specific time zone and displaying it as a label on my storyboard. The time displayed is correct except it doesn't update as time passes by. What am I missing? Here's the code:
- (void)viewDidLoad {
# pragma mark TimeZones
NSDate *now = [NSDate date];
NSDateFormatter *formatter2 = [[NSDateFormatter alloc] init];
[formatter2 setDateStyle:NSDateFormatterShortStyle];
[formatter setDateFormat:@"hh:mm"];
[formatter2 setTimeZone:[NSTimeZone timeZoneWithName:@"Australia/Sydney"]];
NSLog(@"%@",[formatter2 stringFromDate:now]); //--> 11:54 PM
[formatter setTimeZone:[NSTimeZone timeZoneWithName:@"Europe/Paris"]];
NSLog(@"%@",[formatter2 stringFromDate:now]);
NSString *strSelectedDate= [formatter stringFromDate:now];
self.zone.text = strSelectedDate;
}