Convert timestamps to formats Postgres accepts.