Epoch seconds to timestamp(纪元秒转时间戳)¶
Supported in: Batch, Faster, Streaming
Converts from epoch seconds to timestamp in UTC.
Expression categories: Cast, Datetime
Declared arguments¶
- Expression: Converts from epoch seconds to timestamp in UTC.
Expression\
Output type: Timestamp
Examples¶
Example 1: Base case¶
Description: You can convert epoch timestamps to the timestamp type
Argument values:
- Expression: 1673964111
Output: 2023-01-17T14:01:51Z
Example 2: Base case¶
Description: You can convert epoch timestamps as doubles to the timestamp type
Argument values:
- Expression: 1673964111.005
Output: 2023-01-17T14:01:51.005Z
Example 3: Base case¶
Description: Random strings are read as null
Argument values:
- Expression: foobar
Output: null
Example 4: Base case¶
Description: You can convert epoch timestamps as strings to the timestamp type
Argument values:
- Expression: 1673964111
Output: 2023-01-17T14:01:51Z
Example 5: Null case¶
Description: Null columns remain null
Argument values:
- Expression:
input
| input | Output |
|---|---|
| null | null |
Example 6: Null case¶
Description: Null string columns remain null
Argument values:
- Expression:
input
| input | Output |
|---|---|
| null | null |
中文翻译¶
纪元秒转时间戳¶
支持:批处理(Batch)、快速处理(Faster)、流处理(Streaming)
将纪元秒(epoch seconds)转换为UTC时间戳。
表达式类别: 类型转换(Cast)、日期时间(Datetime)
声明的参数¶
- 表达式(Expression): 将纪元秒转换为UTC时间戳。
表达式\
输出类型: Timestamp
示例¶
示例1:基础案例¶
描述: 您可以将纪元时间戳转换为时间戳类型
参数值:
- 表达式: 1673964111
输出: 2023-01-17T14:01:51Z
示例2:基础案例¶
描述: 您可以将双精度浮点数形式的纪元时间戳转换为时间戳类型
参数值:
- 表达式: 1673964111.005
输出: 2023-01-17T14:01:51.005Z
示例3:基础案例¶
描述: 随机字符串将被读取为null
参数值:
- 表达式: foobar
输出: null
示例4:基础案例¶
描述: 您可以将字符串形式的纪元时间戳转换为时间戳类型
参数值:
- 表达式: 1673964111
输出: 2023-01-17T14:01:51Z
示例5:空值案例¶
描述: 空列保持为null
参数值:
- 表达式:
input
| input | 输出 |
|---|---|
| null | null |
示例6:空值案例¶
描述: 空字符串列保持为null
参数值:
- 表达式:
input
| input | 输出 |
|---|---|
| null | null |