On Fri, May 15, 2020 at 9:38 AM PegoraroF10 <[email protected]> wrote:
> Ok Tom but then you cannot go back and forth, like this ...
>
> select to_timestamp(jsonb_build_object('mydate',
> current_timestamp)->>'mydate', 'YYYY-MM-DD HH24:MI:SS');
>
>From here [1] - there are 2 green boxes on the page marked "Tip" - the
second one is of interest here.
Apparently the portable format for your need would be
select to_timestamp('2020-04-02T18:26:50.941531-03:00',
'YYYY-MM-DDtHH24:MI:SS');
That works on both PG 11 and PG 12.
John W Higgins
[1] - https://www.postgresql.org/docs/12/functions-formatting.html