Home > database >  How to convert TIMETZ to TIMESTAMPTZ in Postgres
How to convert TIMETZ to TIMESTAMPTZ in Postgres

Time:02-12

I have a column of timestamps with the type TIMETZ. How do I copy it to an empty column with the type TIMESTAMPTZ with today's date?

CodePudding user response:

Like so:

--Given this:
select current_date    '08:00'::timetz; 
2022-02-11 08:00:00-08

--Do this:
update some_table set timestamp_tz_col = current_date   time_tz_col;

  • Related