phacility/phabricator · error · PhutilArgumentUsageException

Unable to parse date

Error message

Unable to parse date "%s". Use a format like "%s".

What it means

Raised in loadDate() when strtotime() cannot interpret the --date argument (or parses it to a non-positive epoch). It is an input validation guard meaning the date string supplied on the command line is not a recognizable datetime format.

Solutions

  1. Re-run the command passing the date in an unambiguous format such as 2000-01-01 or a unix timestamp
  2. Quote the date argument so the shell does not mangle it
  3. Use a standard ISO 8601 date string; avoid relative or locale-specific formats
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php:298 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/0bcf323b9c020358. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php:298

    $map = $query->getIdentifierMap();
    foreach ($identifiers as $identifier) {
      if (empty($map[$identifier])) {
        throw new PhutilArgumentUsageException(
          pht('No repository "%s" exists!', $identifier));
      }
    }

    return $repos;
  }

  private function loadDate($date) {
    if (!$date) {
      return null;
    }

    $epoch = strtotime($date);
    if (!$epoch || $epoch < 1) {
      throw new PhutilArgumentUsageException(
        pht(
          'Unable to parse date "%s". Use a format like "%s".',
          $date,
          '2000-01-01'));
    }

    return $epoch;
  }

  private function loadCommits($commits) {
    $names = $this->parseList($commits);
    if (!$names) {
      return null;
    }

    $query = id(new DiffusionCommitQuery())
      ->setViewer($this->getViewer())
      ->withIdentifiers($names);

View on GitHub (pinned to 5720a38cfe)