PHP Tutorial - PHP date_timestamp_get() Function






Definition

The date_timestamp_get() function returns the Unix timestamp.

Syntax

PHP date_timestamp_get() Function has the following syntax.

date_timestamp_get(object);

Parameter

PHP date_timestamp_get() Function has the following parameter.

object - Required. DateTime object returned by date_create()

Return

PHP date_timestamp_get() Function returns the Unix timestamp that represents the date.

Example

Return the Unix timestamp for today's date and time:


<?php
$date=date_create();
echo date_timestamp_get($date);
?>

The code above generates the following result.