หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Creates timestamp from the number of milliseconds since UTC epoch.
For the corresponding Databricks SQL function, see timestamp_millis function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.timestamp_millis(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,)], ['millis'])
df.select('*', dbf.timestamp_millis('millis')).show()
spark.conf.unset("spark.sql.session.timeZone")