-5

In instagram API,I got the below response

"created_time" = 1379598284;

I want to convert the created_time to NSDate

please help me

Arpit Kulsreshtha
  • 2,462
  • 2
  • 27
  • 51
Richard
  • 141
  • 1
  • 3
  • 11

4 Answers4

3

use this

NSDate *date = [NSDate dateWithTimeIntervalSince1970:(ms / 1000.0)];
Andriy
  • 2,757
  • 2
  • 19
  • 29
raghu_dev
  • 131
  • 11
2

simple try this...

  NSDate* date = [NSDate dateWithTimeIntervalSince1970:yourtime];

Happy Coding

NiravPatel
  • 3,270
  • 2
  • 19
  • 31
1

try this... as per follow to decode to date

NSDate *tr = [NSDate dateWithTimeIntervalSince1970:1379598284];

or

NSDate *tr = [NSDate dateWithTimeIntervalSinceReferenceDate:1379598284];

OR

NSDate *tr = [NSDate dateWithTimeIntervalSinceNow:1379598284];
user1673099
  • 3,275
  • 7
  • 25
  • 56
0

This is "2013-09-19 13:44:44 +0000" Try following line of code.

NSDate *date = [NSDate dateWithTimeIntervalSince1970:1379598284];
Muhammad Idris
  • 2,118
  • 1
  • 13
  • 9