How to get the current time zone in lens c

I need to get the time zone for the current location, such as -5 or +3, and so on. I can not do it. I am using datecomponents:

// Turn the date into Integers
NSInteger year = [dateComponents year];
NSInteger month = [dateComponents month];
NSInteger day = [dateComponents day];
+3
source share
1 answer
NSDateFormatter *date_formater=[[NSDateFormatter alloc]init];
[date_formater setDateFormat:@"Z"];
NSString * tz=[date_formater stringFromDate:[NSDate date]];
+6
source

Source: https://habr.com/ru/post/1766309/


All Articles