December 13, 2010
Posted by on
If you’re parsing JSON result from a webservice that returns date as double value and you like to display the human readable date formatted NSDate, one possible method we could achieve this is by using NSDate dateWithTimeIntervalSince1970. As our example below, we like to convert the value of “exp” from Double and vice versa.
Parsing this in Objective-C is pretty straightforward and you only need NSDate class for the conversion.
And when we run it via SImulator, we can see similar result here:
Simple and useful.
Reference: NSDate Class Reference