Added from_unix operator #1535

This commit is contained in:
Mike Farah
2023-02-02 12:42:36 +11:00
parent d21bb920d6
commit 75920481b1
5 changed files with 63 additions and 0 deletions
+8
View File
@@ -39,6 +39,14 @@ var dateTimeOperatorScenarios = []expressionScenario{
"D0, P[], (doc)::a: cool\nupdated: 2021-05-19T01:02:03Z\n",
},
},
{
description: "From Unix",
subdescription: "Converts from unix time",
expression: `1675301929 | from_unix`,
expected: []string{
"D0, P[], (!!timestamp)::2023-02-02T12:38:49+11:00\n",
},
},
{
description: "Timezone: from standard RFC3339 format",
subdescription: "Returns a new datetime in the specified timezone. Specify standard IANA Time Zone format or 'utc', 'local'. When given a single parameter, this assumes the datetime is in RFC3339 format.",