date_timestamp_get

Gets the Unix timestamp

Syntax

date_timestamp_get ( DateTimeInterface $object ) : int

Parameters

object

A DateTime object returned by date_create().

Return

Returns the Unix timestamp representing the date.

Examples

<?

$object = date_create();

$return = date_timestamp_get($object);

echo $return;

?>
1638811564

PHP

Home Menu