//获取系统是24小时制或者12小时制
NSString *formatStringForHours = [NSDateFormatter dateFormatFromTemplate:@"j" options:0 locale:[NSLocale currentLocale]];
NSRange containsA = [formatStringForHours rangeOfString:@"a"];
BOOL has_AMPM = containsA.location != NSNotFound;
has_AMPM==TURE为12小时制,否则为24小时制
网友评论