How to format Instagram date in Objective-C

I have a little problem, when I get a response from Instagramm, I get this date format:

            "created_time" = 1361964707;

What the hell does that mean? and especially, how can I format this using NSdataFormatter?

I am looking for a way to format such a date.

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

thanks

+4
source share
2 answers

Computers usually calculate dates as the number of seconds from some arbitrary point in time ("era date".) You can use floating point numbers for the accuracy of a second.

The date of the UNIX era is midnight, January 1970 is UTC. (Average time AKA Greenwich.)

The era's date for Mac OS and iOS is midnight in January, 2001.

Unix Epoch - . - Unix.

NSDate " " NSDate:

+[NSDate dateWithTimeIntervalSince1970:]      //Unix Epoch to NSDate
+[NSDate dateWithTimeIntervalSinceReferenceDate:] //Mac * iOS Epoch to NSDate

-[NSDate timeIntervalSince1970]  //Unix epoch value for an NSDate
-[NSDate timeIntervalSinceReferenceDate]  //Mac & iOS epoch value for an NSDate

, timeIntervalSince1970 NSDate. , , , , .

NSDate UTC:

  NSTimeInterval interval = 1361964707.0;
  NSDate *aDate = [NSDate dateWithTimeIntervalSince1970: interval];
  NSLog(@"Date = %@", aDate);

= 2013-02-27 11:31:47 +0000

, 2013 , , .

+4

unix (http://en.wikipedia.org/wiki/Unix_time).

NSDate [NSDate dateWithTimeIntervalSince1970:]; , NSDateFormatter .

+5

All Articles