document updated 14 years ago, on Jan 25, 2010
Important date/time functions:
- TO_DATE() — convert string ⇒ date
- default date format is 'DD-MON-YY' (example date: '31-DEC-1999')
- TO_CHAR() — convert date ⇒ string
- default date format is 'DD-MON-YY' (example date: '31-DEC-1999')
- TRUNC() — like int() or floor(), but for dates
If you're trying to construct a valid date that TO_DATE() will accept, you can play around with this query until you get it right:
SELECT TO_DATE('January 15, 1989') FROM dual;
- showing the current value of NLS_DATE_FORMAT
- [SQL*Plus] SELECT value FROM nls_session_parameters WHERE parameter='NLS_DATE_FORMAT';