time_handler function

Handle and parse a time