- datetime format elements ==> http://goo.gl/q8Nz8
cf.) alter session set nls_language = american;
- date format: (nls_date_format)
select current_date, current_timestamp, localtimestamp from dual;
alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS';
alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS AM';
==> ERROR: ORA-01818: 'HH24' precludes use of meridian indicator
alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS.';
alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS.S';
alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS.SS';
alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS.SSS';
alter session set nls_date_format = 'DD-MON-YYYY HH24:MI:SS.SSSSS';
- timestamp format: (nls_timestamp_format)
alter session set nls_timestamp_format = 'YYYY-MM-DD HH24:MI:SS.FF';
alter session set nls_date_format = 'RR-MON-DD HH:MI:SS PM';
select current_date, current_timestamp, localtimestamp from dual;
- timestamp with time zone format: (nls_timestamp_tz_format)
alter session set nls_timestamp_tz_format = 'YYYY+MM+DD HH/MI/SS^FF (TZH:TZM)';
select current_date, current_timestamp, localtimestamp from dual;
'Oracle > SQL Fundamentals II' 카테고리의 다른 글
14일차 # 5-12: TIMESTAMP Fields (0) | 2012.04.23 |
---|---|
14일차 # 5-10: Timestamp Data Type (0) | 2012.04.23 |
14일차 # 5-5: 세션의 현재 날짜 및 시간 관련함수들 (0) | 2012.04.23 |
14일차 # dbtimezone vs. sessiontimezone (0) | 2012.04.23 |
14일차 # 5-4: Time Zone Setting (0) | 2012.04.23 |