-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,452
  • 2
  • 26
  • 52
Richard
  • 139
  • 1
  • 3
  • 11

4 Answers4

3

use this

NSDate *date = [NSDate dateWithTimeIntervalSince1970:(ms / 1000.0)];
Andriy
  • 2,767
  • 2
  • 21
  • 29
raghu_dev
  • 91
  • 11
2

simple try this...

  NSDate* date = [NSDate dateWithTimeIntervalSince1970:yourtime];

Happy Coding

NiravPatel
  • 3,260
  • 2
  • 21
  • 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,293
  • 7
  • 26
  • 57
0

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

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