Ensure timestamp is in the right format