Frage

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?

War es hilfreich?

Lösung

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

date("...", (int)$date);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top