I want to get the current time and analyze it in the format Stringin 24 hours, for example 13:30.
This is my code:
NSDate *date = [NSDate date];
NSDateFormatter *formatter = [NSDateFormatter new];
[formatter setDateFormat:@"HH:mm"];
NSString *timeString = [formatter stringFromDate:date];
It works on iOS simulator, but on mine iPadI get 3:30 PM.
I played with different formats, but still the same result.
Any idea why?
Thanks in advance.
source
share