Skip to main content
The following formatting codes can be used to convert date/time strings to native date/time objects (with TO_DATE, TO_DATETIME, TO_TIME and TO_TIMESTAMP) and for formatting date/time objects as strings (with TO_CHAR). These characters are interpreted literally: - / , . ; : Other characters need to be quoted in order to be interpreted literally. For example, MM-DD-YYYY can be used to convert 01-02-2022 to a date, while "Today is "MM-DD-YYYY is needed to convert Today is 01-02-2022. In the following table, Opt in the Input column indicates that the field may be empty when being read, and still be considered a valid input. This can be useful when reading data from a source that, for example, sometimes includes milliseconds in their time strings and sometimes does not (e.g., the MMM code is Opt). Yes in the Input column indicates that some data must be present in the input string to be considered valid, unless it is after a $ character, in which case all input after the $ is optional.