DateTime::setTimestamp
PHP 5 >= 5.3.0, PHP 7, PHP 8
DateTime::setTimestamp - Sets the date and time based on an Unix timestamp
Manual
DateTime::setTimestamp(
int$timestamp ): public DateTime
Procedural style
DateTimedate_timestamp_set DateTimeobject inttimestampParameters
- object
Procedural style only: A DateTime object returned by date_create. The function modifies this object.
- timestamp
-
Unix timestamp representing the date. Setting timestamps outside the range of int is possible by using DateTime::modify with the @ format.
Return Values
Returns the DateTime object for method chaining or false on failure.