convert timestamp correctly