dbVoiceDate
不對,爲什麼?iOS NSDateFormatter返回錯誤日期
我試了很多!
NSDateFormatter *formatterVoice = [[NSDateFormatter alloc] init];
formatterVoice.dateFormat = @"dd-MMM-yyyy hh:mm:ss";
dbVoiceDate = [formatterVoice dateFromString:dbDateStr];
獲得響應:
dbDateStr的印刷描述:
03-Oct-2016 10:43:59
的self->dbVoiceDate
印刷描述:
2016-10-03 05:02:16 +0000
在此先感謝。
時區是問題,請參閱http://stackoverflow.com/questions/16621330/nsdateformatter-not-working-to-set-settimezone –
http://stackoverflow.com/questions/8442706/nsdateformatter-and -time-zone-issue –
什麼樣的約會你不會告訴我..然後我給你完美的答案。 –