to_char with time format


CREATE TABLE EMP (EMPNO NUMBER(4) NOT NULL,
                      HIREDATE DATE);

INSERT INTO EMP VALUES (1, TO_DATE('17-DEC-1980', 'DD-MON-YYYY'));
INSERT INTO EMP VALUES (2, TO_DATE('20-FEB-1981', 'DD-MON-YYYY'));


SQL> SELECT empno, TO_CHAR(hiredate, 'DD-MON-YYYY HH24:MI:SS') FROM emp;

     EMPNO TO_CHAR(HIREDATE,'DD
---------- --------------------
         1 17-DEC-1980 00:00:00
         2 20-FEB-1981 00:00:00

SQL>
SQL>
Home »
Oracle »
Conversion Functions » 

to_char:
  1. to_char function
  2. Format salary with to_char
  3. Order by the numeric value of days using to_char
  4. to_char with time format
Related: