Oihana PHP Arango

dateYear.php

Table of Contents

Functions

dateYear()  : string
Return the year component of a given date.

Functions

dateYear()

Return the year component of a given date.

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

Constructs an AQL expression equivalent to:

DATE_YEAR(date)

If no date is provided, the current date (DATE_NOW()) is used.

Parameters
$date : string|int|null = null

A numeric timestamp or ISO 8601 date-time string. Defaults to DATE_NOW() if null.

Tags
example
echo dateYear('2025-10-08T12:00:00Z');
// Produces: DATE_YEAR("2025-10-08T12:00:00Z")

echo dateYear();
// Produces: DATE_YEAR(DATE_NOW())
see
https://docs.arangodb.com/stable/aql/functions/date/#date_year
since
1.0.0
author

Marc Alcaraz

Return values
string

The AQL expression returning the year part of the given date as a number.

On this page

Search results