From 4fcc8d523980f1fac4757897e55dcc2c4e6642f9 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Mon, 4 May 2020 16:27:52 -0600 Subject: [PATCH] added rfc3339 timestamp to glossary --- .../query-data/flux/manipulate-timestamps.md | 13 +++++++------ content/v2.0/reference/flux/language/types.md | 2 +- .../v2.0/reference/flux/stdlib/json/encode.md | 2 +- content/v2.0/reference/glossary.md | 19 ++++++++++--------- .../reference/key-concepts/data-elements.md | 2 +- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/content/v2.0/query-data/flux/manipulate-timestamps.md b/content/v2.0/query-data/flux/manipulate-timestamps.md index 401b98d6a..bc46fcd37 100644 --- a/content/v2.0/query-data/flux/manipulate-timestamps.md +++ b/content/v2.0/query-data/flux/manipulate-timestamps.md @@ -33,18 +33,19 @@ If you're just getting started with Flux queries, check out the following: ## Convert timestamp format -### Convert nanosecond epoch timestamp to RFC3339 +### Convert unix nanosecond timestamp to RFC3339 Use the [`time()` function](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/time/) -to convert a **nanosecond** epoch timestamp to an RFC3339 timestamp. +to convert a [unix **nanosecond** timestamp](/v2.0/reference/glossary/#unix-timestamp) +to an [RFC3339 timestamp](/v2.0/reference/glossary/#rfc3339-timestamp). ```js time(v: 1568808000000000000) // Returns 2019-09-18T12:00:00.000000000Z ``` -### Convert RFC3339 to nanosecond epoch timestamp +### Convert RFC3339 to nanosecond unix timestamp Use the [`uint()` function](/v2.0/reference/flux/stdlib/built-in/transformations/type-conversions/uint/) -to convert an RFC3339 timestamp to a nanosecond epoch timestamp. +to convert an RFC3339 timestamp to a unix nanosecond timestamp. ```js uint(v: 2019-09-18T12:00:00.000000000Z) @@ -55,8 +56,8 @@ uint(v: 2019-09-18T12:00:00.000000000Z) Flux doesn't support mathematical operations using [time type](/v2.0/reference/flux/language/types/#time-types) values. To calculate the duration between two timestamps: -1. Use the `uint()` function to convert each timestamp to a nanosecond epoch timestamp. -2. Subtract one nanosecond epoch timestamp from the other. +1. Use the `uint()` function to convert each timestamp to a unix nanosecond timestamp. +2. Subtract one unix nanosecond timestamp from the other. 3. Use the `duration()` function to convert the result into a duration. ```js diff --git a/content/v2.0/reference/flux/language/types.md b/content/v2.0/reference/flux/language/types.md index 495e6450a..636cbc564 100644 --- a/content/v2.0/reference/flux/language/types.md +++ b/content/v2.0/reference/flux/language/types.md @@ -75,7 +75,7 @@ The time type name is `time`. The time type is nullable. #### Timestamp format -Flux supports [RFC3339](https://tools.ietf.org/html/rfc3339#section-5.6) timestamps: +Flux supports [RFC3339 timestamps](/v2.0/reference/glossary/#rfc3339-timestamp): - `YYYY-MM-DD` - `YYYY-MM-DDT00:00:00Z` diff --git a/content/v2.0/reference/flux/stdlib/json/encode.md b/content/v2.0/reference/flux/stdlib/json/encode.md index b875e925b..b8610cf9a 100644 --- a/content/v2.0/reference/flux/stdlib/json/encode.md +++ b/content/v2.0/reference/flux/stdlib/json/encode.md @@ -22,7 +22,7 @@ json.encode(v: "some value") This function encodes [Flux types](/v2.0/reference/flux/language/types/) as follows: -- `time` values in [RFC3339](https://tools.ietf.org/html/rfc3339) format +- `time` values in [RFC3339](/v2.0/reference/glossary/#rfc3339-timestamp) format - `duration` values in number of milliseconds since the epoch - `regexp` values as their string representation - `bytes` values as base64-encoded strings diff --git a/content/v2.0/reference/glossary.md b/content/v2.0/reference/glossary.md index 156afc678..0c9a97443 100644 --- a/content/v2.0/reference/glossary.md +++ b/content/v2.0/reference/glossary.md @@ -779,6 +779,13 @@ Related entries: [duration](#duration), [measurement](#measurement), [replicatio --> +### RFC3339 timestamp +A timestamp that uses the human readable DateTime format proposed in +[RFC 3339](https://tools.ietf.org/html/rfc3339) (for example: `2020-01-01T00:00:00.00Z`). +Flux and InfluxDB clients return query results with RFC3339 timestamps. + +Related entries: [timestamp](#timestamp), [unix timestamp](#unix-timestamp) + ## S ### schema @@ -927,13 +934,8 @@ Related entries: [bin](#bin) ### step-plot -<<<<<<< HEAD A data visualization that displays time series data in a staircase graph. Generate a step-plot using the step [interpolation option for line graphs](/v2.0/visualize-data/visualization-types/graph/#options). -======= -In InfluxDB 1.x, a [step-plot graph](https://docs.influxdata.com/chronograf/v1.7/guides/visualization-types/#step-plot-graph) displays time series data in a staircase graph. -In InfluxDB 2.0, generate a similar graph using the step interpolation option for [line graphs](/v2.0/visualize-data/visualization-types/graph/#options). ->>>>>>> master ### stream @@ -1025,7 +1027,7 @@ Time in InfluxDB is in UTC. To specify time when writing data, see [Elements of line protocol](/v2.0/reference/syntax/line-protocol/#elements-of-line-protocol). To specify time when querying data, see [Query InfluxDB with Flux](/v2.0/query-data/get-started/query-influxdb/#2-specify-a-time-range). -Related entries: [point](#point), [unix timestamp](#unix-timestamp) +Related entries: [point](#point), [unix timestamp](#unix-timestamp), [RFC3339 timestamp](#rfc3339-timestamp) ### token @@ -1077,8 +1079,7 @@ An implicit block that encompasses all Flux source text in a universe block. ### unix timestamp -The number of a given unit of time since the **Unix Epoch (1970-01-01T00:00:00Z UTC)**. -The unit of time is also known as the [precision](#precision). +Counts time since **Unix Epoch (1970-01-01T00:00:00Z UTC)** in specified units ([precision](#precision)). Specify timestamp precision when [writing data to InfluxDB](/v2.0/write-data/). InfluxDB supports the following unix timestamp precisions: @@ -1091,7 +1092,7 @@ InfluxDB supports the following unix timestamp precisions:

The examples above represent 2020-01-01T00:00:00Z UTC.

-Related entries: [timestamp](#timestamp) +Related entries: [timestamp](#timestamp), [RFC3339 timestamp](#rfc3339-timestamp) ### user diff --git a/content/v2.0/reference/key-concepts/data-elements.md b/content/v2.0/reference/key-concepts/data-elements.md index f8ca28895..89cb7484f 100644 --- a/content/v2.0/reference/key-concepts/data-elements.md +++ b/content/v2.0/reference/key-concepts/data-elements.md @@ -40,7 +40,7 @@ _Hover over highlighted terms to get acquainted with InfluxDB terminology and la ## Timestamp -All data stored in InfluxDB has a `_time` column that stores timestamps. On disk, timestamps are stored in epoch nanosecond format. InfluxDB formats timestamps show the date and time in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) UTC associated with data. Timestamp precision is important when you write data. +All data stored in InfluxDB has a `_time` column that stores timestamps. On disk, timestamps are stored in epoch nanosecond format. InfluxDB formats timestamps show the date and time in [RFC3339](/v2.0/reference/glossary/#rfc3339-timestamp) UTC associated with data. Timestamp precision is important when you write data. ## Measurement