PySpark SQL Functions | dayofmonth method
Start your free 7-days trial now!
PySpark SQL Functions'
dayofmonth(~) method extracts the day component of each column value, which can be of type date or a date string.
The date column from which to extract the day of the month.
Column object of integers.
Consider the following PySpark DataFrame with some
Extracting the day component of datetime values in PySpark DataFrame
To extract the day component of date values:
Here, we are assigning a label to the
Column returned by
Extracting the day component of date strings in PySpark DataFrame
To extract the day component of date strings: