convert date to timestamp bug fix