Problem Summary
I would like to convert and validate the timestamp which is in YYYY-MM-DDTHH:mm:ss.SSSZ format (ex: 2022-06-15T08:27:00.599Z) in postgres.
I tried
select * from my_table WHERE my_date >= date_trunc('second', '2022-06-15T08:27:00.599Z'::timestamp)
select to_char(to_timestamp('2022-06-15T08:27:00.599Z','YYYY-MM-DD\"T\"HH24:MI:SS'),'YYYY-MM-DD HH24:MI:SS')
These queries are executing fine in db_fiddle but giving an errors while running in python and postgres SQL.
Facing errors
RROR: TEIID31100 Parsing error: Encountered "'2022-06-15T08:27:00.599Z','YYYY-MM-DD"T"HH24:MI:SS), '[]YYYY[]-MM" at line 1, column 672.Was expecting: "and" | "between" | "in" | "is" | "like" | "like_regex" | "not" | "or" | "order" | "similar" ...org.teiid.jdbc.TeiidSQLException: TEIID31100 Parsing error: Encountered "'2022-06-15T08:27:00.599Z','YYYY-MM-DD"T"HH24:MI:SS), '[]YYYY[]-MM" at line 1, column 672.Was expecting: "and" | "between" | "in" | "is" | "like" | "like_regex" | "not" | "or" | "order" | "similar" ...;Error while executing the query nil
My need
Input timestamp : 2022-06-15T08:27:00.599Z
Expected timestamp : 2022-06-15 08:27:00
Appreciate your support.