How to Format a Date in Oracle

Last updated August 25, 2026 · By the SaturnSQL team

Use TO_CHAR(date, format_mask) to render a DATE as text: TO_CHAR(hire_date, 'YYYY-MM-DD'). Add the fm modifier to drop leading zeros and padding.

SELECT TO_CHAR(hire_date, 'YYYY-MM-DD') AS iso_date,
       TO_CHAR(hire_date, 'DD-MON-YYYY') AS display_date,
       TO_CHAR(hire_date, 'YYYY-MM-DD HH24:MI:SS') AS with_time
FROM employees;

Common format masks

DD, MM, YYYY are day/month/4-digit-year. MON is the abbreviated month name (JAN, FEB), MONTH the full name, DY the abbreviated weekday. HH24 is 24-hour, HH12 with AM/PM needs the AM (or PM) element. Case in the mask controls case in the output: 'Mon' renders 'Aug', 'MON' renders 'AUG'.

SELECT TO_CHAR(hire_date, 'Day, DD Month YYYY') AS long_form,
       TO_CHAR(hire_date, 'HH12:MI AM') AS clock_time
FROM employees;

MONTH and DAY are fixed-width and blank-padded to the longest name in the language ('May ' has trailing spaces to match 'September'). Prefix with fm to suppress that padding and also strip leading zeros from numeric elements: TO_CHAR(hire_date, 'fmMonth DD, YYYY') gives 'August 25, 2026' instead of 'August 25, 2026'.

Run this in SaturnSQL

SaturnSQL is a browser-based SQL editor for teams: shared query library, schema-aware autocomplete, and scheduled exports to Google Sheets and Slack.

Try it free

Do more with Oracle

Related Oracle guides