bug fix about localtime_r