PHP » GoLang |
login |
register |
about
|
DateTime::diffDateTimeImmutable::diffDateTimeInterface::diffdate_diff(PHP 5 >= 5.3.0 < 5.5.0) DateTime::diff -- DateTimeImmutable::diff -- DateTimeInterface::diff -- date_diff — Returns the difference between two DateTime objects DescriptionObject oriented style
public DateInterval DateTimeImmutable::diff
( DateTimeInterface
$datetime2
[, bool $absolute = FALSE
] )
public DateInterval DateTimeInterface::diff
( DateTimeInterface
$datetime2
[, bool $absolute = FALSE
] )Procedural style
DateInterval date_diff
( DateTimeInterface
$datetime1
, DateTimeInterface $datetime2
[, bool $absolute = FALSE
] )Returns the difference between two DateTimeInterface objects. Parameters
Return Values
The DateInterval object representing the
difference between the two dates or ExamplesExample #1 DateTime::diff() example Object oriented style
<?php Procedural style
<?php The above examples will output: +2 days Example #2 DateTime object comparison
<?php The above example will output: bool(false) bool(true) bool(false) See Also
|
more
Recently updated
more
Most requested
more
Last requests
|