Logo

Programming-Idioms

History of Idiom 98 > diff from v20 to v21

Edit summary for version 21 by ancarda:
[PHP] secure.php.net isn't required anymore; there's SSL on the main domain (www.php.net)

Version 20

2019-09-27, 03:19:07

Version 21

2019-09-27, 10:07:20

Idiom #98 Epoch seconds to date object

Convert a timestamp ts (number of seconds in epoch-time) to a date with time d. E.g. 0 -> 1970-01-01 00:00:00

Idiom #98 Epoch seconds to date object

Convert a timestamp ts (number of seconds in epoch-time) to a date with time d. E.g. 0 -> 1970-01-01 00:00:00

Code
$d = DateTime::createFromFormat('U', $ts);
Code
$d = DateTime::createFromFormat('U', $ts);
Doc URL
https://secure.php.net/manual/en/datetime.createfromformat.php
Doc URL
https://www.php.net/manual/en/datetime.createfromformat.php
Demo URL
https://3v4l.org/miIdh
Demo URL
https://3v4l.org/miIdh