Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Returns the current session local timezone.
For the corresponding Databricks SQL function, see current_timezone function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.current_timezone()
Returns
pyspark.sql.Column: current session local timezone.
Examples
spark.conf.set("spark.sql.session.timeZone", "America/Los_Angeles")
+-------------------+
| current_timezone()|
+-------------------+
|America/Los_Angeles|
+-------------------+
from pyspark.databricks.sql import functions as dbf
spark.range(1).select(dbf.current_timezone()).show()
spark.conf.set("spark.sql.session.timeZone", "Asia/Shanghai")
spark.range(1).select(dbf.current_timezone()).show()
spark.conf.unset("spark.sql.session.timeZone")
+------------------+
|current_timezone()|
+------------------+
| Asia/Shanghai|
+------------------+