mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-02 15:14:52 +08:00
Added from_unix operator #1535
This commit is contained in:
@@ -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.",
|
||||
|
||||
Reference in New Issue
Block a user