Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
10.0.2.0
-
None
Description
The documentation for datatypes DATE, TIME, and TIMESTAMP is incomplete. The documentation says that DATE, TIME, and TIMESTAMP accept any values accepted by the java.sql.Date, java.sql.Time, and java.sql.Timestamp classes respectively. Derby accepts a number of string formats:
DATE:
yyyy-mm-dd
mm/dd/yyyy
dd.mm.yyyy
TIME:
hh:mm[:ss]
hh.mm[.ss]
hh[:mm]
TIMESTAMP:
yyyy-mm-dd-hh[.mm[.ss[.nnnnnn]]]
yyyy-mm-dd hh[:mm[:ss[.nnnnnn]]]
The year must always have 4 digits. Months, days, and hours may have one or two digits. Minutes and seconds, if present, must have two digits. Nanoseconds, if present may have 1 to 6 digits.
Derby also accepts strings in the locale specific datetime format, using the locale of the database server. If there is an ambiguity the built in formats above take precedence.
Attachments
Attachments
Issue Links
- relates to
-
DERBY-2203 Not all documented TIMESTAMP formats are properly recognized by TIMESTAMP() and CAST() functions
- Closed