I am working on a project and I am having an issue formatting an epoch time to a human readable time.
I have the following epoch time 1428512160
and when I
You need to add an @
for the timestamp in the DateTime class, like this:
$dt = new DateTime("@" . $supportDetails["Reported"]);
//^ See here
You can also see this in the manual. And a quote from there:
Unix Timestamp "@" "-"? [0-9]+ "@1215282385"
Also note that the current timezone is getting ignored, which you can also see in the manual:
Note: The $timezone parameter and the current timezone are ignored when the $time parameter either is a UNIX timestamp (e.g. @946684800) or specifies a timezone (e.g. 2010-01-28T15:00:00+02:00).