What's wrong with how I'm using NSDateFormatter?

后端 未结 5 463
闹比i
闹比i 2021-01-30 10:01
   NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
   dateFormatter.locale = [[[NSLocale alloc] initWithLocaleIdentifier:@\"en_US\"] autorelease];
   [d         


        
5条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-30 10:30

    you have a zero padded day, namely 08 in your date string, however in your format string the format is trying to parse a non-zero padded day, namely d. changing d to dd should fix the problem

提交回复
热议问题