roskakori / cutplace

validate data stored in CSV, PRN, ODS or Excel files
http://cutplace.readthedocs.org/
GNU Lesser General Public License v3.0
18 stars 20 forks source link

Improve Excel data fields #110

Closed roskakori closed 8 years ago

roskakori commented 9 years ago

Currently Excel date fields only support the format YYYY-MM-DD hh:mm:ss and use some heuristics to decide if it is a date or time only fields.

Actually Excel supports custom formats, as described in for example https://www.ablebits.com/office-addins-blog/2015/03/11/change-date-format-excel/#custom-date-format. Most of them can be mapped to to a cutplace DateTime format.

roskakori commented 8 years ago

Currently xlrd does not seem to support custom formats very well. In particular there are differences between classic Excel .xls and XML Excel .xlsx.

As a consequence, the improved cutplace reader at least checks the rule of the DateTime fields and now allows for YYYY-MM-DD hh:mm:ss, YYYY-MM-DD or hh:mm:ss. This makes it possible to specify plain dates and times.