0

I am trying to convert an epoch time to Date object. But I am getting wrong value.

My epoch time is this 1586863971924

My code is :

let date = Date(timeIntervalSince1970: 1586863971924)

  print("date - \(date)")

Output:

date - 52255-09-20 03:45:24 +0000

When I am using this link https://www.epochconverter.com/ to convert this epoch time the I am getting this output:

enter image description here

Why my code is showing wrong answer. Suggest me how to convert this epoch time to correct date object.

ajeet sharma
  • 803
  • 10
  • 37

0 Answers0