Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to format Instagram date in Objective-C

i have a little problem, when i get the answer from Instragm, i get this date format:

            "created_time" = 1361964707;

what the hell does this means?? and specially how can i format this with the NSdataFormatter?

I am looking for a way to format a date like this.

"created_time": "Wed Dec 01 17:08:03 +0000 2010"

thanks

like image 596
Max_Power89 Avatar asked Jan 13 '23 03:01

Max_Power89


1 Answers

It's a unix timestamp (http://en.wikipedia.org/wiki/Unix_time).

You convert it to NSDate with [NSDate dateWithTimeIntervalSince1970:]; once that's done, you can use NSDateFormatter on it.

like image 139
jsd Avatar answered Jan 18 '23 14:01

jsd