sample.alignToNow() shifts time values in input data to align the chronological last point to now.
Input data must have a
When writing static historical sample datasets to InfluxDB Cloud,
sample.alignToNow() to avoid losing sample data with timestamps outside
of the retention period associated with your InfluxDB Cloud account.
Align sample data timestamps to the current time
import "influxdata/influxdb/sample" option now = () => 2021-01-01T00:00:00Z data = sample.data(set: "birdMigration") |> filter(fn: (r) => r._field == "lon" and r.s2_cell_id == "471ed2c" and r.id == "91916A" ) |> tail(n: 3) data |> sample.alignToNow()
View input and output
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, the following resources are available:
InfluxDB Cloud customers can contact InfluxData Support.