Oihana PHP Arango

yesterday.php

Table of Contents

Functions

yesterday()  : string
Return the date corresponding to "yesterday" based on the given date or the current date.

Functions

yesterday()

Return the date corresponding to "yesterday" based on the given date or the current date.

yesterday([int|string|null $date = null ]) : string

Constructs an AQL expression equivalent to:

DATE_SUBTRACT(date, 1, "day")

If no date is provided, the current date (from DATE_NOW()) is used as the reference point.

Parameters
$date : int|string|null = null

Numeric timestamp or ISO 8601 date string. Defaults to DATE_NOW() if null.

Tags
example
echo yesterday('2025-10-08T00:00:00Z');
// Produces: DATE_SUBTRACT("2025-10-08T00:00:00Z", 1, "day")

echo yesterday();
// Produces: DATE_SUBTRACT(DATE_NOW(), 1, "day")
see
https://docs.arangodb.com/stable/aql/functions/date/#date_subtract
since
1.0.0
author

Marc Alcaraz

Return values
string

The AQL expression returning the ISO 8601 string for the date of yesterday.

On this page

Search results