Returns the year in the specified time zone.
String identifier or alias for a time zone, such as |
|tsExpression||Optional expression to which you want to apply this function.|
year() standard time function returns the year in the specified time zone, represented as a 4-digit number in the Gregorian calendar.
The returned values are plotted against the times shown on the x-axis. The returned series is generally a straight line, unless you are looking at a chart that includes times around 12:00am on January 1.
year() automatically adjusts its return values for daylight savings time.
year() is particularly useful when you want to define an alert that fires only during a specific year or range of years. For example, you could use an expression such as
year("US/Pacific")=2018 in an alert condition to ensure that the alert fires only during the year 2018 Pacific Time, and stops firing at the end of that year.
Example 2: Showing Years
This chart shows live data, so
year("UTC") shows the current year in Coordinated Universal Time. Notice that the year is displayed in SI units (2.018k) on this particular y-axis. For details on SI units, see Wikipedia or a similar source.
If we set a custom date for the chart from December to May, the series returned by
year("UTC") shows the change in year.
Example 2: Defining an Alert that Fires in a Particular Year
Here we include
year("UTC")=2018 in a conditional expression to define an alert that fires when the CPU load average rises above 2.0 during the year 2018 UTC.