system.time() function

The system.time() function returns the current system time.

Function type: Date/Time
Output data type: Timestamp

import "system"



import "system"

  |> set(key: "processed_at", value: string(v: system.time() ))

system.time() vs now()

system.time() returns the current system time of the host machine, which typically accounts for the local time zone. This time represents the time at which system.time() it is executed, so each instance of system.time() in a Flux script returns a unique value.

now() returns the current UTC time. now() is cached at runtime, so all instances of now() in a Flux script return the same value.

New! Cloud or OSS?

InfluxDB OSS 2.0 release candidate

InfluxDB OSS v2.0.rc includes breaking changes that require a manual upgrade from all alpha and beta versions. For information, see:

Upgrade to InfluxDB OSS v2.0.rc