Merge pull request #207 from influxdata/flux/function-updates

Flux function updates
pull/209/head
Scott Anderson 2019-05-01 14:18:25 -06:00 committed by GitHub
commit 783ded263f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 79 additions and 27 deletions

View File

@ -0,0 +1,24 @@
---
title: now() function
description: The `now()` function returns the current time (GMT).
menu:
v2_0_ref:
name: now
parent: built-in-misc
weight: 401
---
The `now()` function returns the current time (GMT).
_**Function type:** Date/Time_
_**Output data type:** Time_
```js
now()
```
## Examples
```js
data
|> range(start: -10h, stop: now())
```

View File

@ -1,25 +0,0 @@
---
title: systemTime() function
description: The `systemTime()` function returns the current system time.
aliases:
- /v2.0/reference/flux/functions/misc/systemtime
menu:
v2_0_ref:
name: systemTime
parent: built-in-misc
weight: 401
---
The `systemTime()` function returns the current system time.
_**Function type:** Date/Time_
_**Output data type:** Timestamp_
```js
systemTime()
```
## Examples
```js
offsetTime = (offset) => systemTime() |> shift(shift: offset)
```

View File

@ -20,7 +20,7 @@ _**Function type:** Transformation_
_**Output data type:* Object_
```js
range(start: -15m, stop: now)
range(start: -15m, stop: now())
```
## Parameters
@ -45,7 +45,7 @@ _**Data type:** Duration or Timestamp_
{{% note %}}
Flux only honors [RFC3339 timestamps](/v2.0/reference/flux/language/types#timestamp-format)
and ignores dates and times provided in other formats.
and ignores dates and times provided in other formats.
{{% /note %}}
## Examples

View File

@ -0,0 +1,22 @@
---
title: Flux system package
list_title: System package
description: >
The Flux system package provides functions for reading values from the system.
Import the `system` package.
menu:
v2_0_ref:
name: System
parent: Flux packages and functions
weight: 204
v2.0/tags: [system, functions, package]
---
The Flux system package provides functions for reading values from the system.
Import the `system` package:
```js
import "system"
```
{{< children type="functions" show="pages" >}}

View File

@ -0,0 +1,31 @@
---
title: system.time() function
description: The `system.time()` function returns the current system time.
aliases:
- /v2.0/reference/flux/functions/misc/systemtime
- /v2.0/reference/flux/functions/built-in/misc/systemtime
menu:
v2_0_ref:
name: system.time
parent: System
weight: 401
---
The `system.time()` function returns the current system time.
_**Function type:** Date/Time_
_**Output data type:** Timestamp_
```js
import "system"
system.time()
```
## Examples
```js
import "system"
data
|> set(key: "processed_at", value: string(v: system.time() ))
```