NSDateFormatter dateFromString:stringDate returning nil in iOS 8.3

前端 未结 1 1248
情话喂你
情话喂你 2021-01-22 04:07

I have this code

NSString *stringDate = @\"2015-07-09 7:00 AM\";
NSString *stringDateFormat = @\"yyyy-MM-dd h:mm a\";
NSTimeZone *timeZone =  [NSTimeZone localTi         


        
1条回答
  •  再見小時候
    2021-01-22 04:20

    It's almost a canned response but: QA1480. Set your formatter's locale to en_US_POSIX or its behaviour will be dependent upon the user's settings.

    0 讨论(0)
提交回复
热议问题