How to convert time to some category?

For example, times between 17:30:13 and 19:30:13 should be categorized as "in the evening." Times between 12:00:12 and 13:00:12 should fall under "noon."

What is a good approach to do this in python?