TIMESTAMP WITH TIMEZONE and TIMESTAMP WITH LOCAL TIMEZONE
select systimestamp systimestmp, LOCALTIMESTAMP localtimstmp, DBTIMEZONE ,SESSIONTIMEZONE from dual;
create table date_table ( time_stamp_tz TIMESTAMP WITH TIME ZONE,time_stamp_ltz TIMESTAMP WITH LOCAL TIME ZONE);
insert into date_table values (SYSTIMESTAMP,SYSTIMESTAMP);
alter session set time_zone='+14:00';
insert into date_table values (LOCALTIMESTAMP,LOCALTIMESTAMP );
alter session set time_zone='00:00';
insert into date_table values (SYSDATE,SYSDATE );
select * from date_table;
select time_stamp_tz from date_table;
select time_stamp_tz ,TO_CHAR( time_stamp_tz , 'dd-mon-yyyy hh:mi:ss') from date_table;
select time_stamp_tz,TO_CHAR(time_stamp_tz at time zone '+00:00', 'dd-mon-yyyy hh:mi:ss'), time_stamp_tz at local from date_table;
select systimestamp systimestmp, LOCALTIMESTAMP localtimstmp, DBTIMEZONE ,SESSIONTIMEZONE from dual;
create table date_table ( time_stamp_tz TIMESTAMP WITH TIME ZONE,time_stamp_ltz TIMESTAMP WITH LOCAL TIME ZONE);
insert into date_table values (SYSTIMESTAMP,SYSTIMESTAMP);
alter session set time_zone='+14:00';
insert into date_table values (LOCALTIMESTAMP,LOCALTIMESTAMP );
alter session set time_zone='00:00';
insert into date_table values (SYSDATE,SYSDATE );
select * from date_table;
select time_stamp_tz from date_table;
select time_stamp_tz ,TO_CHAR( time_stamp_tz , 'dd-mon-yyyy hh:mi:ss') from date_table;
select time_stamp_tz,TO_CHAR(time_stamp_tz at time zone '+00:00', 'dd-mon-yyyy hh:mi:ss'), time_stamp_tz at local from date_table;
No comments:
Post a Comment