PHP: DateTime::setTimestamp - Manual (original) (raw)
date_timestamp_set
(PHP 5 >= 5.3.0, PHP 7, PHP 8)
DateTime::setTimestamp -- date_timestamp_set — Sets the date and time based on an Unix timestamp
Parameters
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 usingDateTimeImmutable::modify() with the @ format.
Return Values
Returns the modified DateTime object for method chaining.
See Also
- DateTimeImmutable::setTimestamp() - Sets the date and time based on a Unix timestamp