to_char(gather_date, 'mm/dd/yyyy hh:mi') : TO_CHAR « Date Timestamp Functions « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL> create table my_stats_table
  2  (object_name  varchar2(30),
  3   gather_date  date default sysdate);

Table created.

SQL>
SQL> select object_name, to_char(gather_date, 'mm/dd/yyyy hh:mi') from my_stats_table
  2  /

no rows selected

SQL>
SQL> drop table my_stats_table;

Table dropped.

SQL>
SQL>








13.20.TO_CHAR
13.20.1.Formatting Dates with TO_CHAR
13.20.2.An alias is required when using TO_CHAR to 'pretty up' the output
13.20.3.TO_CHAR(Start_Date, 'dd Month yyyy')
13.20.4.TO_CHAR(Start_Date, 'dd month YY')
13.20.5.TO_CHAR(Start_Date, 'dd Mon')
13.20.6.TO_CHAR(Start_Date, 'dd RM yyyy')
13.20.7.TO_CHAR(Start_Date, 'Day Mon yyyy')
13.20.8.TO_CHAR(Start_Date, 'Day fmMonth dd, yyyy')
13.20.9.TO_CHAR(Start_Date, 'Mon ddsp yyyy')
13.20.10.TO_CHAR(Start_Date, 'ddMon yy hh24:mi:ss')
13.20.11.TO_CHAR(sysdate,'HH24:MI:SS')
13.20.12.select TO_CHAR(sysdate,'HH.MI.SS AM') from dual;
13.20.13.to_char(gather_date, 'mm/dd/yyyy hh:mi')