now() function
The now()
function returns the current time (UTC) or the time defined in the now
option.
now()
Examples
Use the current UTC time as a query boundary
data
|> range(start: -10h, stop: now())
Return the now option time
option now = () => 2020-01-01T00:00:00Z
now()
// Returns 2020-01-01T00:00:00.000000000Z
now() vs system.time()
now()
returns the current system time (UTC).
now()
is cached at runtime, so all instances of now()
in a Flux script
return the same value.
system.time()
returns the system time (UTC)
at which system.time()
is executed.
Each instance of system.time()
in a Flux script returns a unique value.
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.