Documentation

timezone.fixed() function

timezone.fixed() constructs a timezone record with a fixed offset from UTC. Fixed timezones are not affected by location-based time shifts in the clock such as daylight savings time or summertime.

import "timezone"

timezone.fixed(offset: -2h)

// Returns {offset: -2h, zone: UTC}

Parameters

offset

(Required) The fixed duration for the location offset. The duration is the offset from UTC time.

Examples

Apply a fixed timezone offset to windows
import "array"
import "timezone"

option location = timezone.fixed(offset: -8h)

data = array.from(
    rows: [
        {_time: 2021-01-01T00:06:00Z, _value: 1},
        {_time: 2021-01-02T00:06:00Z, _value: 2},
        {_time: 2021-01-03T00:06:00Z, _value: 3},
    ],
)
    |> range(start: 2021-01-01T00:00:00Z, stop: 2021-01-04T00:00:00Z)

data
    |> window(every: 1d)

View example input and output data


Was this page helpful?

Thank you for your feedback!


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.