Du kan bruge denne forespørgsel uden at skulle bekymre dig om tidszoneændringer.
select to_char(cast(application_recv_date as timestamp) at time zone 'US/Eastern',
'MON dd, YYYY'
)
from application;
Eks:
EDT:
select cast(date'2014-04-08' as timestamp) d1,
cast(date'2014-04-08' as timestamp) at time zone 'US/Eastern' d2
from dual;
D1 D2
---------------------------------- -------------------------------------------
08-APR-14 12.00.00.000000 AM 07-APR-14 08.00.00.000000 PM US/EASTERN
EST:
select cast(date'2014-12-08' as timestamp) d1,
cast(date'2014-12-08' as timestamp) at time zone 'US/Eastern' d2
from dual;
D1 D2
---------------------------------- -------------------------------------------
08-DEC-14 12.00.00.000000 AM 07-DEC-14 07.00.00.000000 PM US/EASTERN
OPDATERING:
Tak til Alex Poole for at minde om, at når tidszone ikke er angivet, bruges lokal tidszone til konvertering.
For at tvinge datoen til at blive genkendt som GMT, skal du bruge from_tz.
from_tz(cast(date'2014-12-08' as timestamp), 'GMT') at time zone 'US/Eastern'