add global time format function that replace before