corrected a bug about localtime