Oracle Date Format Tester
Test Oracle TO_CHAR / TO_DATE format masks instantly. Enter a date and format string to see the formatted output.
Enter a date
Case-sensitive. Use double quotes for literal text: "of"
Formatted Output
Invalid date
Format Token Reference
| Token | Description |
|---|---|
| YYYY | 4-digit year (2024) |
| YYY | 3-digit year (024) |
| YY | 2-digit year (24) |
| Y | 1-digit year (4) |
| IYYY | ISO 4-digit year |
| IY | ISO 2-digit year |
| RRRR | Round-trip year (handles 2-digit) |
| RR | Round-trip 2-digit year |
| MM | Month number (01-12) |
| MON | Abbreviated month (JAN) |
| MONTH | Full month name (JANUARY) |
| RM | Roman numeral month (I-XII) |
| DD | Day of month (01-31) |
| DDD | Day of year (001-366) |
| D | Day of week (1-7) |
| DAY | Full day name (MONDAY) |
| DY | Abbreviated day (MON) |
| J | Julian day number |
| HH24 | Hour 24-hour (00-23) |
| HH12 | Hour 12-hour (01-12) |
| HH | Hour 12-hour (01-12) |
| MI | Minute (00-59) |
| SS | Second (00-59) |
| SSSSS | Seconds past midnight (0-86399) |
| FF | Fractional seconds |
| AM/PM | Meridian indicator |
| A.M./P.M. | Meridian with dots |
| Q | Quarter (1-4) |
| W | Week of month (1-5) |
| WW | Week of year (1-53) |
| IW | ISO week of year (1-52/53) |
| CC | Century |
| SCC | Century with BC/AD |
| SP | Spell number (spelled out) |
| TH | Ordinal suffix (ST, ND, RD, TH) |
| SPTH | Spelled ordinal (FIRST, SECOND...) |
Common Examples
YYYY-MM-DD
Standard ISO date
DD-MON-YYYY
Day-Month abbrev-Year
Month DD, YYYY
Full month name
MON DD, YYYY
Abbreviated month
Day, Month DD, YYYY
Day name + full date
YYYY-MM-DD HH24:MI:SS
Full datetime 24hr
DD/MM/YYYY HH:MI AM
12-hour with AM/PM
YYYY-"Q"Q
Year and quarter
IW/IYYY
ISO week/year
DDSPTH "of" Month
Ordinal day (1st, 2nd...)
YYYY-MM-DD"T"HH24:MI:SS
ISO 8601
J
Julian day number
Modifiers
- TH — Ordinal suffix:
DDTH→01ST,02ND,03RD - SP — Spell number:
DDSP→ONE,TWO - SPTH — Spelled ordinal:
DDSPTH→FIRST,SECOND - FM — Fill mode (suppress padding):
FMMonth→January(no trailing spaces) - Literal text — Double quotes:
'of'→of
Tips
- Oracle format masks are case-sensitive — use
YYYY,MM,DD,HH24,MI,SS TO_CHAR(date, 'YYYY-MM-DD')formats a date to stringTO_DATE('2024-01-15', 'YYYY-MM-DD')parses string to date- For 12-hour time use
HH:MI AM; for 24-hour useHH24:MI RR/RRRRhandle 2-digit years with 50-year pivot (1950-2049)- Use
IW+IYYYfor ISO week/year
Related tools
More from Developer Tools
Build custom software with us
From internal tools to full platforms — we deliver end to end.
Was this tool useful?