How can i convert this string to a int8 in PostgreSQL 12?
2021-10-18T17:45:22Z
i tried:
TO_TIMESTAMP('2021-10-18T17:45:22Z'::text,'YYYY-MM-DD hh:mm:ss ')::int8
to_char('2021-10-18T17:45:22Z', 'YYYY-MM-DD hh:mm:ss ')::integer
and a few variations of these but without any success.
The Input string cannot change because it is passed this way by an external software.
2021-10-18T17:45:22Zthat's not just a date, it's a date with an offset. This represents different times in each timezone. Removing the offset loses important information