YEAR()
All functions > DATE AND TIME > YEAR()
Returns the year component of a date or timestamp.
Signatures
Returns: The year component
YEAR(timestamp: T) → BIGINT sql
| Parameter | Type | Required | Description |
|---|---|---|---|
timestamp | T | Yes | A DATE or TIMESTAMP value |
With:
T: Custom types: DATE | TIMESTAMP
Notes
- Permissive spelling of
DATE_PART(timestamp, 'year') - Also accepts TIMESTAMP
Examples
FeatureQL
RETURN
-- Extract year
f1 := DATE_PART(DATE '2024-03-15', 'year')
;Result
| f1 BIGINT |
|---|
| 2024 |
On this page