time() function

The time() function converts a single value to a time.

*Function type: Type conversion
**
Output data type:* Time

  1. time(v: "2016-06-13T17:43:50.1004002Z")

Parameters

v

The value to convert.

*Data type: Integer | String | Uinteger*

time() assumes all numeric input values are nanosecond epoch timestamps.

Examples

  1. from(bucket: "sensor-data")
  2. |> range(start: -1m)
  3. |> filter(fn:(r) => r._measurement == "system" )
  4. |> map(fn:(r) => ({ r with timestamp: time(v: r.timestamp) }))