SQL
MySQL QUARTER() Function
Return the quarter of the year for the date: