0
目前,我有一個NSString的價值包含以下日期爲當前日期轉換的NSString的NSDate正在產生錯誤值
(lldb) po self.currentDate
(NSString *) $5 = 0x002ca8d0 2013-03-29
但是,當我這的NSString轉換成NSDate的,它顯示錯誤的值
NSDate *myCurrentDate = [dateFormatterForCurrentDate dateFromString:self.currentDate];
(lldb) po myCurrentDate
(NSDate *) $4 = 0x002cf030 2013-03-28 18:30:00 +0000
**這是正確的!**這在時區顯示相對於GMT。 –
Anoop是正確的。看到我的[對早期問題的答案](http://stackoverflow.com/questions/11273001/nsdateformatter-datefromstring-returns-incorrect-date/11273812#11273812)。 –