PHP date_timestamp_set() Function

PHP date_timestamp_set Function


Definition : 

In php date_timestamp_set() Function is inbuilt function.PHP date_timestamp_set() function is used to sets the date and time based on the given Unix timestamp. It returns the DateTime object for method chaining on success or False on failure. It accepts two different parameters $object and $unixtimestamp.

Syntax

   date_timestamp_set(object, unixtimestamp)

Parameter 
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

Given below example Set the date and time based on a Unix timestamp:

Output: 1472713181 = 2016-09-01 06:59:41