Definition
The date_timestamp_set() function sets the date and time based on an Unix timestamp.
Syntax
date_timestamp_set(object, unixtimestamp)
Parameters
Parameter | Description |
---|---|
object |
Required. Specifies a DateTime object returned by date_create() . This function modifies this object. |
unixtimestamp |
Required. Specifies a Unix timestamp representing the date. |
Example
<?php
$date = date_create();
date_timestamp_set($date,1371803321);
echo date_format($date, "U = Y-m-d H:i:s");