Task #11108 (closed)
Opened 11 years ago
Closed 11 years ago
RFE: expand reader date format coverage
Reported by: | mtbcarroll | Owned by: | rleigh |
---|---|---|---|
Priority: | minor | Milestone: | Testing and Docs |
Component: | Bio-Formats | Version: | 4.4.8 |
Keywords: | n.a. | Cc: | bf@… |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | n.a. |
Sprint: | Testing and Docs (1) |
Description
In importing ome/data_repo/public/images/HCS/Operetta/59549/ I see many log messages from loci.formats.in.BaseTiffReader like,
unknown creation date format: 2013-04-03T09:03:04.432Z
That format looks like pretty standard ISO8601 to me; probably it should be supported?
Change History (6)
comment:1 Changed 11 years ago by mlinkert
- Milestone changed from Unscheduled to Testing
- Sprint set to Testing and Docs (1)
- Version set to 4.4.8
comment:2 Changed 11 years ago by rleigh
- Owner changed from mlinkert to rleigh
comment:3 Changed 11 years ago by rleigh
comment:4 Changed 11 years ago by rleigh
comment:5 Changed 11 years ago by jamoore
With the PRs opened, can this be closed, Roger?
comment:6 Changed 11 years ago by rleigh
- Resolution set to fixed
- Status changed from new to closed
Closing.
Note: See
TracTickets for help on using
tickets.
You may also have a look at Agilo extensions to the ticket.
Initial support for better date format coverage and also for millisecond timestamps is here:
https://github.com/rleigh-dundee/bioformats/commit/d75b8f0e507d3214419b7b8e1ae5d0fc2dfdecc5
I'll open a PR once it's had more testing.
Note that due to the awfulness of the standard Date/Calendar? types, this uses Joda Instant/DateTime?. This gives us essentially full coverage of xsd:dateTime and vastly greater coverage of all ISO-8601. For output we use the same fixed format string as before, but with the addition of milliseconds when we have a timestamp with millisecond precision (we don't write out .000 for timestamps which dont't require the extra precision to avoid breaking old parsers and testcases since it has zero impact on our behaviour). I initially looked at implementing it just in terms of SimpleDateFormat?, trying a number of different format strings, but this ends up being quite hairy and fragile, so I've gone with a well supported solution which will definitely work.
It may be worth extending this work to replace all existing Date/Calendar? usage in the codebase. This will give us vastly more robust and reproducible date handling. The use is relatively restricted, so wouldn't be much extra additional work on top of this.