Skip to toolbar

SQL Date Formats List Updated(2020)

Here are the SQL Date Formats List. You can try yourself and look for the output.

These SQL date formats list are useful in your interview point of view or also can be used in your professional SQL work environment.

  1. Select TO_CHAR(date_column, ‘DD-MON-YYYY’) from emp21;
    Formats:
    d,dd,ddd
    mm,mon,month
    y,yy,yyy,yyyy,year
  2. select to_char(sysdate,’dd-mm-yyyy hh:mi:ss’) from dual;
  3. Select TO_CHAR(number_column, ’99,999.00’) from emp21; – If there is decimal value display as it is and if it is not there display .00
  4. Select to_char(salary, ‘99999.9999’) from emp21;
  5. SQL> Select to_char(sysdate, ‘yyyy/mm/dd’) FROM dual;
    ‘2010/12/24’
  6. SQL> Select to_char(sysdate, ‘FMMonth DD, YYYY’) FROM dual;
    ‘June 9, 2005’
  7. SQL> select to_char(sysdate,’HH24:MI:SS’) “Time Now” from dual;
    ’14:35:56′
  8. SQL> Select to_char(1.234, ‘9999.9’) FROM dual;
    ‘1.2’
  9. SQL> Select to_char(1000.25, ‘9,999.99’) FROM dual;
    ‘1,000.25’
  10. SQL> Select to_char(1000.25, ‘$9,999.00’) FROM dual;
    ‘$1,000.25’
  11. SQL> Select to_char(emp_date, ‘DD-MM-YYYY HH24:MI’) FROM emp21;
    31-12-2005 23.30

Leave a comment