pyspark.sql.functions.
quarter
Extract the quarter of a given date as integer.
Examples
>>> df = spark.createDataFrame([('2015-04-08',)], ['dt']) >>> df.select(quarter('dt').alias('quarter')).collect() [Row(quarter=2)]
previous
pyspark.sql.functions.year
next
pyspark.sql.functions.month