NSString *string = [NSDateFormatter dateFormatFromTemplate:@"j" options:0 locale:[NSLocale currentLocale]];
NSRange range = [string rangeOfString:@"a"];
BOOL hasAMPM = range.location != NSNotFound;
hasAMPM = true 表示当前时间为12 小时制 相反 为24小时制
时间: 2024-10-04 08:09:09