我从数据库中得到一个unix时间戳,我试图从它创建一个可读的日期。我正在使用这种方式如何将unix时间戳转换为人类可读时间?
long t1=[time longLongValue];
NSDate* date=[NSDate dateWithTimeIntervalSince1970:t1];
其中time是时间戳。当我打印日期,我得到
1956-02-18 19:04:01 +0000
,而不是
2013-01-02 12:31:03 +0000
时间戳是1356765933449
阅读[this](https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/DataFormatting/Articles/dfDateFormatting10_4.html)和[this](http://stackoverflow.com/问题/ 5739598/setting-date-format-for-nsdateformatter) – tkanzakic