handled overflow in format_time