Date, time, and timestamp formats
- Last Updated: August 5, 2020
- 1 minute read
- DataDirect Connectors
- JDBC
- Autonomous REST Connector 6.0
- Documentation
By default, the driver interprets values of the Data, Time, and Timestamp
data types using the default ISO 8061 formats:
YYYY-MM-DDHH:MM:SS.sssssssssZYYYY-MM-DDTHH:MM:SS.sssssssssZ
The driver provides additional flexibility in parsing ISO formats:
- The value can consist of less than the full number of digits. For example,
1970-1-1is acceptable, as opposed to1970-01-01. - The fractional second and timezone values are optional.
- For timestamps, dates or the date portions of values can use
/or-as separators. - For timestamps, the separator between the date and time portions can be an empty space
instead of a
T.
However, if necessary, you can also specify your own format after the data
type element (or after #key element in the primary key
column) in your column definition, using the Java SimpleDateFormat. These definitions take
the following form:
"<column_name>":"<data_type>","<java_date_format>"
where:
- column_name
- is the name of the column.
- data_type
- is either the
Date,TimeorTimestampdata type. - java_date_format
- specifies the format of your Date, Time, or Timestamp values using the Java SimpleDateFormat. For more information on the Java SimpleDateFormat, refer to https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html.
For example:
"birthday":"date","d-M-y-G"