Man Page: datetimeinterface.gettimestamp
Operating Environment: php
Section: 3
DATETIMEINTERFACE.GETTIMESTAMP(3) 1 DATETIMEINTERFACE.GETTIMESTAMP(3) DateTime::getTimestamp - Gets the Unix timestamp Object oriented style SYNOPSIS
public int DateTime::getTimestamp (void ) DESCRIPTION
int DateTimeImmutable::getTimestamp (void ) int DateTimeInterface::getTimestamp (void ) Procedural style int date_timestamp_get (DateTimeInterface $object) Gets the Unix timestamp. PARAMETERS
This function has no parameters. RETURN VALUES
Returns the Unix timestamp representing the date. EXAMPLES
Example #1 DateTimeInterface.getTimestamp(3) example Object oriented style <?php $date = new DateTime(); echo $date->getTimestamp(); ?> Procedural style <?php $date = date_create(); echo date_timestamp_get($date); ?> The above examples will output something similar to: 1272509157 NOTES
Using U as the parameter to DateTime.format(3) is an alternative when using PHP 5.2. SEE ALSO
DateTime.setTimestamp(3), DateTime.format(3). PHP Documentation Group DATETIMEINTERFACE.GETTIMESTAMP(3)
| Related Man Pages |
|---|
| datetimeimmutable.diff(3) - php |
| datetime.format(3) - php |
| datetime.sub(3) - php |
| datetime.gettimezone(3) - php |
| datetimeimmutable.format(3) - php |
| Similar Topics in the Unix Linux Community |
|---|
| store timestamp in a variable |
| Unix Script for getting date and validating just Hour |
| How to extract timestamp from the filename? |
| PHP embedding functions inside strings? |
| nth date |