标签:
需要设置Locale
NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
[dateFormatter setDateFormat:@"yyyyMMddHHmmss"];
NSDate *currentDate = [[[NSDate alloc] init] autorelease];
[dateFormatter setCalendar:[NSCalendar autoupdatingCurrentCalendar]];
[dateFormatter setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:@"en_US"] autorelease]];
NSString *strDate = [dateFormatter stringFromDate:currentDate];
http://stackoverflow.com/questions/7072267/why-does-my-nsdateformatter-sometimes-return-an-a-m-or-p-m-with-yyyymmddhhmmss
版权声明:本文为博主原创文章,未经博主允许不得转载。
Why does my NSDateFormatter sometimes return an a.m. or p.m. with yyyyMMddHHmmssSSS
标签:
原文地址:http://blog.csdn.net/dengmeiyu/article/details/47154057