split format_time out to a util module!