DateTime::getTimestampDateTimeImmutable::getTimestampDateTimeInterface::getTimestampdate_timestamp_getGets the Unix timestamp DescriptionObject oriented style
public int DateTime::getTimestamp
( void
)
public int DateTimeImmutable::getTimestamp
( void
)
public 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 DateTime::getTimestamp example Object oriented style
<?php Procedural style
<?php The above examples will output something similar to: 1272509157 NotesUsing U as the parameter to DateTime::format is an alternative when using PHP 5.2. See Also
|