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 number of days since 1970-01-01.
For the corresponding Databricks SQL function, see unix_date function.
Syntax
from pyspark.sql import functions as dbf
dbf.unix_date(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or str |
input column of values to convert. |
Returns
pyspark.sql.Column: the number of days since 1970-01-01.
Examples
from pyspark.sql import functions as dbf
df = spark.createDataFrame([('1970-01-02',), ('2022-01-02',)], ['dt'])
df.select('*', dbf.unix_date(dbf.to_date('dt'))).show()