EXTRACT() in MySQL — How It Works
What the MySQL EXTRACT() function does, with an example.
Published October 20, 2026
EXTRACT() extracts a specific part (year, month, hour, etc.) from a date or time value.
Key points
- Part of standard SQL functions available in MySQL for working with dates and times
Example
SELECT EXTRACT(YEAR FROM NOW());