timestamp_micros
Creates timestamp from the number of microseconds since UTC epoch.
For the corresponding Databricks SQL function, see timestamp_micros function.
Syntax
Python
from pyspark.databricks.sql import functions as dbf
dbf.timestamp_micros(col=<col>)
Parameters
Parameter | Type | Description |
|---|---|---|
|
| unix time values. |
Returns
pyspark.sql.Column: converted timestamp value.
Examples
Python
spark.conf.set("spark.sql.session.timeZone", "UTC")
Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(1230219000,), (1280219000,)], ['micros'])
df.select('*', dbf.timestamp_micros('micros')).show(truncate=False)
spark.conf.unset("spark.sql.session.timeZone")