date_timestamp_set

Its an alias of DateTime::setTimestamp() and sets the date and time based on an Unix timestamp .
Example

<?php
$date1 = date_create();
echo date_format($date1, ‘U = Y-m-d H:i:s’).”<br />”;

date_timestamp_set($date1, 1171502325);
echo date_format($date1, ‘U = Y-m-d H:i:s’);
?>

Output

1335329740 = 2012-04-25 10:25:40
1171502325 = 2007-02-15 06:48:45

Share