Q:
iOS 代码里,手机系统时间设置为 12 小时制时,转出的时间戳带中文 ’上午’,’下午’ 的问题
A:
设置上这块 locale 就可以了
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_PoSlX"];
iOS 代码里,手机系统时间设置为 12 小时制时,转出的时间戳带中文 ’上午’,’下午’ 的问题
设置上这块 locale 就可以了
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_PoSlX"];