select pg_catalog.concat(current_date,' 00:00:00')::timestamp /*Formata hora por exemplo no where*/
and plan_signed_at = TO_CHAR(created_at, 'YYYY-mm-dd')::timestamp /*Formata hora por exemplo no where um é date, o outro datetime*/
select NOW() - INTERVAL '180' MINUTE /*pega a data e hora com 3 horas menos*/
select to_char(NOW(), 'yyyy/MM/dd HH24:MI:SS') AS date_no_tz, NOW() as date_tz /*data formatada com e sem timezone*/
SELECT Orderdetails,OrderDate as ExistingDateformat,
to_char(OrderDate,'DD-MM-YYYY') As DDMMYYYY,
to_char(OrderDate,'DD-MM-YY') As DDMMYY,
to_char(OrderDate,'DD.MM.YY') As "DD.MM.YY",
to_char(OrderDate,'MM/DD/YYYY') As "MM/DD/YYYY",
to_char(OrderDate,'DAY MM/DD/YYYY') As "MM/DD/YYYY",
to_char(OrderDate,'DDD MM/DD/YYYY') As "DDD MM/DD/YYYY"
FROM SalesOrders