Bug #3096

Date data type (domain) need be handled correctly

Added by Jing Tao over 14 years ago. Updated over 12 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


Currently, Date data type (domain) in EML document is treated as string in database system. This will cause some limitation in query operation to date data type.


#1 Updated by ben leinfelder over 14 years ago

Tried the first step which uses ISO standard format for dates in the EML metadata/data. postgres is pretty flexible when it comes to date formats, but I'd like to get it so that the formatString in the EML is used to set the format string that the DB table accepts. I think this is very doable...just have to figure out how.
and also implement it for HSQL database adaptor

#2 Updated by ben leinfelder over 14 years ago

implemented datetime handling in both the Postgres and HSQLDB adaptors.
Uses the format string supplied in the EML for the attribute.
For the Postgres adaptor, the mapping of the format strings is straightforward, but for hsql I'm using the SimpleDateFormat to help parse the string into a date and the Java conventions are a tad different than ISO 8601 (what we a re using in EML). I've included some manual conversions where there is no ambiguity (ie. uppercase Y to lowercase y). It is possible that we might encounter more discrepancies as more people use this feature.

This change also means that the format string becomes very important - there is case sensitivity lurking here and we cannot assume that "mm" (minute) really means "MM" (month). I'm sure there are many datapackages that have imperfect format strings.

#3 Updated by ben leinfelder over 12 years ago

as a bug this is resolved - just a final note that format strings are crucial for datetime parsing to be accurate.

#4 Updated by Redmine Admin over 9 years ago

Original Bugzilla ID was 3096

Also available in: Atom PDF