pyspark.sql.functions.date_from_unix_date#

pyspark.sql.functions.date_from_unix_date(days)[source]#

Create date from the number of days since 1970-01-01.

New in version 3.5.0.

Parameters
daysColumn or str

the target column to work on.

Returns
Column

the date from the number of days since 1970-01-01.

Examples

>>> df = spark.range(1)
>>> df.select(date_from_unix_date(lit(1))).show()
+----------------------+
|date_from_unix_date(1)|
+----------------------+
|            1970-01-02|
+----------------------+