How To Convert UNIX Timestamps to Date using PHP CLI

For a quick visual check to see what the human-readable date is based on a UNIX timestamp integer: php -r ‘print date(“r”,1483228799);’ php -r ‘print strtotime(“1 Jan 2015”) – 1;’
![]() |
For a quick visual check to see what the human-readable date is based on a UNIX timestamp integer: php -r ‘print date(“r”,1483228799);’ php -r ‘print strtotime(“1 Jan 2015”) – 1;’
$lastDay = date(“Y-m-t”, strtotime(“-3 months”)); $firstDay = date(“Y-m-01”, strtotime(“-3 months”));