Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: ✅ Microsoft Fabric ✅ Azure Data Explorer ✅ Azure Monitor ✅ Microsoft Sentinel
Returns the year part of the datetime argument.
Syntax
getyear(date)
Learn more about syntax conventions.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| date | datetime |
✔️ | The date for which to get the year. |
Returns
The year that contains the given date.
Examples
The following example returns the year of the given date.
print year = getyear(datetime(2015-10-12))
| year |
|---|
| 2015 |