-1

A third party API is outputting: "1373762187.198" as a valid date time.

When passed through PHPs date function, I get todays date even though I know the object its attached to is over a week old.

Any ideas how todo a correct conversation?

azz0r
  • 3,283
  • 7
  • 42
  • 85

1 Answers1

4

Just strip the decimals away with an integer cast and then pass it to date (or do you need the milliseconds?)

date("...", (int)$date);
bwoebi
  • 23,637
  • 5
  • 58
  • 79