refactored pretty_print_time