Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Finder.php

function Finder::date

Adds tests for file dates (last modified).

The date must be something that strtotime() is able to parse:

$finder->date('since yesterday'); $finder->date('until 2 days ago'); $finder->date('> now - 2 hours'); $finder->date('>= 2005-10-15'); $finder->date(['>= 2005-10-15', '<= 2006-05-27']);

Parameters

string|string[] $dates A date range string or an array of date ranges:

Return value

$this

See also

strtotime

DateRangeFilterIterator

DateComparator

File

vendor/symfony/finder/Finder.php, line 152

Class

Finder
Finder allows to build rules to find files and directories.

Namespace

Symfony\Component\Finder

Code

public function date(string|array $dates) : static {
    foreach ((array) $dates as $date) {
        $this->dates[] = new DateComparator($date);
    }
    return $this;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal