timeConf function to format the date