- 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;


+ Recent posts