File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -439,6 +439,18 @@ public function __isset(string $prop): bool
439439 }
440440 }
441441
442+ /**
443+ * Like \DateTime::diff(), but returns a TimeInterval object.
444+ *
445+ * @param \DateTimeInterface $target The date to compare to.
446+ * @param bool $absolute Whether to force the interval to be positive.
447+ * @return TimeInterval The difference between the two dates.
448+ */
449+ public function diff (\DateTimeInterface $ target , bool $ absolute = false ): TimeInterval
450+ {
451+ return TimeInterval::createFromDateInterval (parent ::diff ($ target , $ absolute ));
452+ }
453+
442454 /**
443455 * Like DateTime::format(), except that it can accept either DateTime format
444456 * specifiers or strftime format specifiers (but not both at once).
You can’t perform that action at this time.
0 commit comments