Menu Home

date_timestamp_set

osbo.com | PHP | Functions | date_timestamp_set

Sets the date and time based on an Unix timestamp

Syntax

date_timestamp_set ( DateTime $object , int $timestamp ) : DateTime

Parameters

object

A DateTime object returned by date_create(). The function modifies this object.

timestamp

Unix timestamp representing the date.

Return

Returns the DateTime object for method chaining or FALSE on failure.

Examples

object timestamp

1618094825 = 2021-04-10 22:47:05

Return

1618094825 = 2021-04-10 22:47:05

PHP