PHP date_timestamp_get() Function

Example

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

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

Run Example

Definition and Usage

The date_timestamp_get() function returns a Unix timestamp.

Syntax

date_timestamp_get(object);
Parameter Description
object Required. Specifies by date_create() Returns the DateTime object.

Technical Details

Return Value: Returns the Unix timestamp representing the date.
PHP Version: 5.3+