Skip to content

passed_today ​

php
boolean passed_today ( string $date, string $dateAttribute, [number $nowTimestamp] )

Checks whether the interval specified by the second argument has elapsed between the date in the first argument (format: 'YYYY.MM.DD') and the date in the third argument. The second argument specifies an interval using y|m|w|d (year, month, week, day). If the third argument is omitted, it defaults to the current time returned by time().

Example:

php
$date = '2019.01.17';
if (passed_today($date, '2d')) {
  print_r('exactly 2 days have elapsed');
} else {
  print_r('a different interval between the dates');
}

Result:

a different interval between the dates