跳转至

Change timestamp time zone(更改时间戳时区)

Supported in: Batch, Faster

Changes the time zone of a timestamp.

Expression categories: Datetime

Declared arguments

  • Output time zone: Target time zone.
    TimeZone
  • Timestamp: Timestamp column.
    Expression\
  • optional Input time zone: Time zone that the current timestamp is recorded in.
    Expression\

Output type: Timestamp

Examples

Example 1: Base case

Argument values:

  • Output time zone: America/Chicago
  • Timestamp: 2020-04-28T05:09:00Z
  • Input time zone: US/Eastern

Output: 2020-04-28T04:09:00Z


Example 2: Base case

Argument values:

  • Output time zone: Australia/Sydney
  • Timestamp: timestamp
  • Input time zone: time_zone
timestamp time_zone Output
2020-04-28T10:09:00Z US/Eastern 2020-04-29T00:09:00Z
2020-04-28T10:09:00Z UTC 2020-04-28T20:09:00Z

Example 3: Null case

Argument values:

  • Output time zone: US/Eastern
  • Timestamp: 2020-04-28T10:09:00Z
  • Input time zone: null

Output: 2020-04-28T06:09:00Z


Example 4: Null case

Argument values:

  • Output time zone: Australia/Sydney
  • Timestamp: timestamp
  • Input time zone: time_zone
timestamp time_zone Output
null US/Eastern null
null null null
2020-04-28T10:09:00Z null 2020-04-28T20:09:00Z

Example 5: Edge case

Argument values:

  • Output time zone: UTC
  • Timestamp: 2025-11-02T01:01:14Z
  • Input time zone: America/Halifax

Output: 2025-11-02T04:01:14Z



中文翻译


更改时间戳时区

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

更改时间戳的时区。

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

声明的参数

  • 输出时区(Output time zone): 目标时区。
    TimeZone
  • 时间戳(Timestamp): 时间戳列。
    Expression\
  • 可选 输入时区(Input time zone): 当前时间戳记录的时区。
    Expression\

输出类型: Timestamp

示例

示例 1:基本情况

参数值:

  • 输出时区: America/Chicago
  • 时间戳: 2020-04-28T05:09:00Z
  • 输入时区: US/Eastern

输出: 2020-04-28T04:09:00Z


示例 2:基本情况

参数值:

  • 输出时区: Australia/Sydney
  • 时间戳: timestamp
  • 输入时区: time_zone
timestamp time_zone 输出
2020-04-28T10:09:00Z US/Eastern 2020-04-29T00:09:00Z
2020-04-28T10:09:00Z UTC 2020-04-28T20:09:00Z

示例 3:空值情况

参数值:

  • 输出时区: US/Eastern
  • 时间戳: 2020-04-28T10:09:00Z
  • 输入时区: null

输出: 2020-04-28T06:09:00Z


示例 4:空值情况

参数值:

  • 输出时区: Australia/Sydney
  • 时间戳: timestamp
  • 输入时区: time_zone
timestamp time_zone 输出
null US/Eastern null
null null null
2020-04-28T10:09:00Z null 2020-04-28T20:09:00Z

示例 5:边界情况

参数值:

  • 输出时区: UTC
  • 时间戳: 2025-11-02T01:01:14Z
  • 输入时区: America/Halifax

输出: 2025-11-02T04:01:14Z