webCOMAND

YEAR()

Return the year part of a date or timestamp as an integer from 0-9999.

Prototype

integer YEAR(mixed $timestamp)

Parameters

  • timestamp - A date ("YYYY-MM-DD") or timestamp ("YYYY-MM-DD HH:MM:SS").

Return

The year portion of a date or timestamp, or NULL if there is an error, such as an invalid timestamp.

Example

SELECT OID, YEAR(META(LastModified)) AS YearModified FROM User

See Also

DAY(), MONTH()