The MySQL MICROSECOND() function is used to return the microsecond component from a time value.
The return value for this function is in the range 0 to 999999. Below are examples to demonstrate.
Database Management Systems
The MySQL HOUR() function is used to return the hour component from a time value.
The return value for a time-of-day value will be between 0 and 23, however the range returned by this function could be much larger, due to the fact that a time data type isn’t limited to just a time of day (it can also be used to represent elapsed time or a time interval between two events). This means that the returned value could be greater than 24 hours or even a negative value.
In MySQL, you can use the GET_FORMAT() function to return a format string for the provided arguments. This can be useful when you need to provide a format string to another function, such as DATE_FORMAT() or STR_TO_DATE().
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.