#Function
In PySpark, the date_format() function is used to format a DateType or TimestampType column into a string in a specified format. This function is part of the pyspark.sql.functions module and can be useful when you need to display or work with date and time data in a more readable or custom format.

Syntax: -

from pyspark.sql.functions import date_format

date_format(column, format)

column: The name of the column containing the date or timestamp.
format: A string representing the desired date/time format.

Common Date/Time Format Patterns:

Important Notes: