0

I've kept my data in firebase with TIMESTAMP generated by firebase. I need to convert them in my iOS app. I tried to do it in following manner but returns complicated result.

NSDate *date = [NSDate dateWithTimeIntervalSince1970:1493292606524];
NSLog(@"Date: %@", date);

It returns Date: 49290-07-23 05:48:44 +0000

What is the issue of above? Result should be today date. (2017-04-27)

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
isuru
  • 3,385
  • 4
  • 27
  • 62

1 Answers1

2

try this need to convert this stamp into seconds

NSDate *date = [NSDate dateWithTimeIntervalSince1970:(1493292606524/1000)];
NSLog(@"Date: %@", date);
Matloob Hasnain
  • 1,025
  • 6
  • 21