Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
getyear()
Switch services using the Version drop-down list. Learn more about navigation.
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 |
Feedback
Was this page helpful?
