Below code snippet converts your UNIX timestamp to a valid date-month-year. However , as shown below. passing pretty large negative unix timestamps can produce unexpected results
<?php
$dt = new DateTime();
$dt->setTimestamp(-1861945262080);
echo $dt->format('d-m-Y');
OUTPUT :
12-08-2035
However, you can still pass negative timestamps above. Consider this passage from wikipedia.
Unix Unix 86400 . , 2004-09-16T00: 00: 00Z, 12677 , Unix 12677 × 86400 = 1095292800. , ; , 1957-10-04T00: 00: 00Z, 4472 , Unix -4472 × 86400 = -386380800.
, -386380800 .
<?php
$dt = new DateTime();
$dt->setTimestamp(-386380800);
echo $dt->format('d-m-Y');
OUTPUT :
04-10-1957
.