Skip to main content
Ctrl+K
PyFlink 1.20+vvr.11.7.dev0 documentation - Home PyFlink 1.20+vvr.11.7.dev0 documentation - Home
  • API Reference
  • Examples
  • API Reference
  • Examples

Section Navigation

  • PyFlink Table
    • TableEnvironment
    • Table
    • Data Types
    • Window
    • Expressions
    • User Defined Functions
    • Descriptors
    • StatementSet
    • Catalog
  • PyFlink DataStream
  • PyFlink DataFrame
  • PyFlink Common
  • API Reference
  • PyFlink Table
  • Expressions
  • pyflink.table.expressions.convert_tz

pyflink.table.expressions.convert_tz#

convert_tz(date_str: str | Expression[str], tz_from: str | Expression[str], tz_to: str | Expression[str]) → Expression[source]#

Converts a datetime string date_str (with default ISO timestamp format ‘yyyy-MM-dd HH:mm:ss’) from time zone tz_from to time zone tz_to. The format of time zone should be either an abbreviation such as “PST”, a full name such as “America/Los_Angeles”, or a custom ID such as “GMT-08:00”. E.g., convert_tz(‘1970-01-01 00:00:00’, ‘UTC’, ‘America/Los_Angeles’) returns ‘1969-12-31 16:00:00’.

Example:

>>> tab.select(convert_tz(col('a'), 'PST', 'UTC'))
Parameters:
  • date_str – the date time string

  • tz_from – the original time zone

  • tz_to – the target time zone

Returns:

The formatted timestamp as string.

Added in version 1.12.0.

previous

pyflink.table.expressions.timestamp_diff

next

pyflink.table.expressions.from_unixtime

On this page
  • convert_tz()

This Page

  • Show Source

Created using Sphinx 7.4.7.

Built with the PyData Sphinx Theme 0.16.1.