63 datediff | months_between | add_months | date_add | month | date_trunc functions in PySpark

Опубликовано: 02 Июнь 2026
на канале: CLOUD LEARN IN HINDI
126
4

current_timestamp(), Datediff(), trunc(), date_add
date_sub, next_day, Month_between(), month(), Add_Month(), Date_Add() and more functions in PySpark and Spark SQL

#pyspark #sparksql #spark #azuredatabricks #databricks

datediff(end, start): Returns the number of days from `start` to `end`.
months_between(end, start): Returns number of months between dates `start` and `end`.
date_add(): Returns the date that is `days` days after `start`
date_sub():
next_day(): Returns the first date which is later than the value of the `date` column that is on the specified day of the week
trunc(column, format): Returns date truncated to the unit specified by the format.For example, `trunc(“2018-11-19 12:01:19”, “year”)` returns 2018-01-01
date_trunc(format, timestamp) :Returns timestamp truncated to the unit specified by the format. For example, `date_trunc(“year”, “2018-11-19 12:01:19”)` returns 2018-01-01 00:00:00
last_day(column):Returns the last day of the month which the given date belongs to.