improved the time format function some more