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.
Converts the number of seconds from the Unix epoch (1970-01-01T00:00:00Z) to a timestamp.
For the corresponding Databricks SQL function, see timestamp_seconds function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.timestamp_seconds(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or str |
unix time values. |
Returns
pyspark.sql.Column: converted timestamp value.
Examples
spark.conf.set("spark.sql.session.timeZone", "UTC")
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(1230219000,), (1280219000,)], ['seconds'])
df.select('*', dbf.timestamp_seconds('seconds')).show()
spark.conf.unset("spark.sql.session.timeZone")