pyspark.sql.functions.
date_sub
Returns the date that is days days before start
New in version 1.5.0.
Examples
>>> df = spark.createDataFrame([('2015-04-08',)], ['dt']) >>> df.select(date_sub(df.dt, 1).alias('prev_date')).collect() [Row(prev_date=datetime.date(2015, 4, 7))]
previous
pyspark.sql.functions.date_format
next
pyspark.sql.functions.date_trunc