跳转至

Truncate timestamp(截断时间戳(Truncate timestamp))

Supported in: Batch, Faster

Returns the timestamp truncated to the specified unit.

Expression categories: Datetime

Declared arguments

  • Start: no description
    Expression\
  • Unit: Time unit used to truncate.
    Enum\

Output type: Timestamp

Examples

Example 1: Base case

Argument values:

  • Start: 2022-02-01T10:10:10.002Z
  • Unit: DAYS

Output: 2022-02-01T00:00:00Z


Example 2: Base case

Argument values:

  • Start: 2022-02-01T10:10:10.002Z
  • Unit: HOURS

Output: 2022-02-01T10:00:00Z


Example 3: Base case

Argument values:

  • Start: 2022-02-01T10:10:10.0022Z
  • Unit: MILLISECONDS

Output: 2022-02-01T10:10:10.002Z


Example 4: Base case

Argument values:

  • Start: 2022-02-01T10:10:10.002Z
  • Unit: MINUTES

Output: 2022-02-01T10:10:00Z


Example 5: Base case

Argument values:

  • Start: 2022-02-01T10:10:10.002Z
  • Unit: MONTHS

Output: 2022-02-01T00:00:00Z


Example 6: Base case

Argument values:

  • Start: 2022-02-01T10:10:10.002Z
  • Unit: QUARTERS

Output: 2022-01-01T00:00:00Z


Example 7: Base case

Argument values:

  • Start: 2022-02-01T10:10:10.0022Z
  • Unit: SECONDS

Output: 2022-02-01T10:10:10Z


Example 8: Base case

Argument values:

  • Start: 2022-02-01T10:10:10.002Z
  • Unit: YEARS

Output: 2022-01-01T00:00:00Z


Example 9: Null case

Argument values:

  • Start: null
  • Unit: YEARS

Output: null



中文翻译


截断时间戳(Truncate timestamp)

支持:批处理(Batch)、快速(Faster)

将时间戳按指定时间单位进行截断。

表达式类别: 日期时间(Datetime)

声明的参数

  • 起始时间(Start): 无描述
    表达式\
  • 时间单位(Unit): 用于截断的时间单位。
    枚举(Enum)\

输出类型: Timestamp

示例

示例 1:基础情况

参数值:

  • 起始时间: 2022-02-01T10:10:10.002Z
  • 时间单位: DAYS

输出: 2022-02-01T00:00:00Z


示例 2:基础情况

参数值:

  • 起始时间: 2022-02-01T10:10:10.002Z
  • 时间单位: HOURS

输出: 2022-02-01T10:00:00Z


示例 3:基础情况

参数值:

  • 起始时间: 2022-02-01T10:10:10.0022Z
  • 时间单位: MILLISECONDS

输出: 2022-02-01T10:10:10.002Z


示例 4:基础情况

参数值:

  • 起始时间: 2022-02-01T10:10:10.002Z
  • 时间单位: MINUTES

输出: 2022-02-01T10:10:00Z


示例 5:基础情况

参数值:

  • 起始时间: 2022-02-01T10:10:10.002Z
  • 时间单位: MONTHS

输出: 2022-02-01T00:00:00Z


示例 6:基础情况

参数值:

  • 起始时间: 2022-02-01T10:10:10.002Z
  • 时间单位: QUARTERS

输出: 2022-01-01T00:00:00Z


示例 7:基础情况

参数值:

  • 起始时间: 2022-02-01T10:10:10.0022Z
  • 时间单位: SECONDS

输出: 2022-02-01T10:10:10Z


示例 8:基础情况

参数值:

  • 起始时间: 2022-02-01T10:10:10.002Z
  • 时间单位: YEARS

输出: 2022-01-01T00:00:00Z


示例 9:空值情况

参数值:

  • 起始时间: null
  • 时间单位: YEARS

输出: null