pyspark.sql.functions.current_timezone#

pyspark.sql.functions.current_timezone()[source]#

Returns the current session local timezone.

New in version 3.5.0.

Returns
Column

current session local timezone.

Examples

>>> spark.conf.set("spark.sql.session.timeZone", "America/Los_Angeles")
>>> spark.range(1).select(current_timezone()).show()
+-------------------+
| current_timezone()|
+-------------------+
|America/Los_Angeles|
+-------------------+
>>> spark.conf.unset("spark.sql.session.timeZone")