NSDate如下:
2013-03-14 17:35:00 +0000
用下面代碼將它轉換成NSString時:
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"MM/dd/yyyy hh:mm:ss"];
[formatter stringFromDate:item.startdate];
結果是這樣:
03/14/2013 05:35:00
怎麼樣修復?
[formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];