Add time2string function.