Convert Openweathermap Sunrise JSON value to NSDate IOS



i'm working on a weather app for school and I don't understand at all how to read the sunrise value returned by the openweathermap API see below (we have to use JSON format) :


JSON :



"sys":{
"sunrise":1418107981,
"sunset":1418140433
}


XML :



<sun rise="2014-12-09T06:52:59" set="2014-12-09T15:53:53"/>


the values are the same but in 2 different format ...


So my question is :


How can I convert this [ "sunrise":1418107981 ] into a NSDate object ?


No comments:

Post a Comment