NCEAS / z-test-issues

Test issue imports from redmine
0 stars 0 forks source link

Date data type (domain) need be handled correctly #431

Closed mbjones closed 7 years ago

mbjones commented 7 years ago

Author Name: Jing Tao (Jing Tao) Original Redmine Issue: 3096, https://projects.ecoinformatics.org/ecoinfo/issues/3096 Original Date: 2008-01-23 Original Assignee: ben leinfelder


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.

mbjones commented 7 years ago

Original Redmine Comment Author Name: ben leinfelder (ben leinfelder) Original Date: 2008-02-29T18:37:14Z


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

mbjones commented 7 years ago

Original Redmine Comment Author Name: ben leinfelder (ben leinfelder) Original Date: 2008-03-01T00:50:27Z


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.

mbjones commented 7 years ago

Original Redmine Comment Author Name: ben leinfelder (ben leinfelder) Original Date: 2010-01-11T19:53:55Z


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

mbjones commented 7 years ago

Original Redmine Comment Author Name: Redmine Admin (Redmine Admin) Original Date: 2013-03-27T21:22:15Z


Original Bugzilla ID was 3096