-1

I have this timestamp how to convert it to unix timestamp

1.6749018E+12

Or is there any way to decode it in PHP let me know. have good day!

My code

$t = '1.6749018E+12';
print date('H:i:s', $t);

Not work!

pico.vn
  • 11
  • 4

1 Answers1

1

1.6749018E+12 looks like a unix time with milliseconds as float number. If I'm right, then the conversion to a unix time in seconds is:

$unixtime = intval($NUMBER/1000)

where $NUMBER is the input number (1.6749018E+12 in you example). This number represents: Sat Jan 28 11:30:00 CET 2023 (or 10:30 UTC).

Wiimm
  • 2,971
  • 1
  • 15
  • 25