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)
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, use the following resources:
InfluxDB Cloud customers can contact InfluxData Support.