Man Page: datetimeimmutable.gettimestamp
Operating Environment: php
Section: 3
DATETIMEIMMUTABLE.GETTIMESTAMP(3) 1 DATETIMEIMMUTABLE.GETTIMESTAMP(3) DateTime::getTimestamp - Gets the Unix timestamp Object oriented styleSYNOPSISpublic int DateTime::getTimestamp (void )DESCRIPTIONint DateTimeImmutable::getTimestamp (void ) int DateTimeInterface::getTimestamp (void ) Procedural style int date_timestamp_get (DateTimeInterface $object) Gets the Unix timestamp.PARAMETERSThis function has no parameters.RETURN VALUESReturns the Unix timestamp representing the date.EXAMPLESExample #1 DateTimeImmutable.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: 1272509157NOTESUsing U as the parameter to DateTime.format(3) is an alternative when using PHP 5.2.SEE ALSODateTime.setTimestamp(3), DateTime.format(3). PHP Documentation Group DATETIMEIMMUTABLE.GETTIMESTAMP(3)
| Related Man Pages |
|---|
| datetimeimmutable.gettimestamp(3) - php |
| datetime.modify(3) - php |
| datetimeimmutable(3) - php |
| datetime.gettimezone(3) - php |
| datetimeinterface.gettimestamp(3) - php |
| Similar Topics in the Unix Linux Community |
|---|
| Bash comparing date |
| How to extract timestamp from the filename? |
| Stress testing php files at Unix/Linux Command line |
| PHP embedding functions inside strings? |
| List files after a certain filename |