Add format_time helper method