close
<?php
$date = date_create();
echo date_format($date, 'U = Y-m-d H:i:s') . "\n";
date_timestamp_set($date, 1171502725);
echo date_format($date, 'U = Y-m-d H:i:s') . "\n";
?>
輸出:
1272508903 = 2010-04-28 22:41:43
1171502725 = 2007-02-14 20:25:25
<?php
$ts = 1171502725;
$date = new DateTime("@$ts");
echo $date->format('U = Y-m-d H:i:s') . "\n";
?>
輸出:
1171502725 = 2007-02-14 20:25:25
全站熱搜