In MySQL, you can use the EXTRACT()
function to extract parts from a date. For example, you can extract the year part, the month part, or the day part, etc. You can also extract parts from the time component, such as minutes, seconds, microseconds, etc.
This article contains examples to demonstrate.