You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Konstantin Gribov (Jira)" <ji...@apache.org> on 2022/11/18 16:41:00 UTC

[jira] [Commented] (TIKA-3493) dcterms:created date depends on the current TimeZone in RTF documents

    [ https://issues.apache.org/jira/browse/TIKA-3493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17635951#comment-17635951 ] 

Konstantin Gribov commented on TIKA-3493:
-----------------------------------------

Just hit the same with one of the tests failing. I looked through RTF spec 1.9 and they effectively have local date/time (just wallclock without time zone) there. 

Right now it's interpreted as date/time in current jvm timezone. Both LibreOffice and Word (on Mac) interpret them the same.

Maybe we should keep it without timezone in the metadata string (in {{dcterms:created}} or another property) and only reinterpret it with a TZ in {{Metadata#getDate}} but it would be a breaking change. Or if we can keep raw representation plus Tika's best guess what instant it meant. Likely to require breaking changes too. 

> dcterms:created date depends on the current TimeZone in RTF documents
> ---------------------------------------------------------------------
>
>                 Key: TIKA-3493
>                 URL: https://issues.apache.org/jira/browse/TIKA-3493
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 2.0.0
>            Reporter: David Pilato
>            Assignee: Tim Allison
>            Priority: Minor
>         Attachments: Test_case_to_demo_the_change_with_Tika_1_x1.patch
>
>
> {color:#333333}I'm migrating an existing project to Tika 2.0.0.
> I'm seeing a strange behavior.
> TL;DR: the created date of the document changes depending on the timezone.
> Long story:
> I have a unit test which extracts content and metadata from a [RTF document|[https://github.com/dadoonet/fscrawler/raw/master/test-documents/src/main/resources/documents/test.rtf]].
> When using Tika 1.27, whatever the timezone defined for my JVM, I'm always getting the same value for "dcterms:created": "2016-07-07T13:38:00Z".
> When running the same test with Tika 2.0.0, the date changes depending on the Timezone.
> For example:
> {color}
>  * {color:#333333}Asia/Sakhalin gives dcterms:created=2016-07-06T23:38:00Z
> {color}
>  * {color:#333333}Asia/Colombo gives dcterms:created=2016-07-07T05:08:00Z
> {color}
>  * {color:#333333}Europe/Stockholm gives dcterms:created=2016-07-07T08:38:00Z
> {color}
>  
> {color:#333333}I don't know if it's a bug or expected. May be the RTF format does not specify the Timezone.
> I'm surprised that I don't see the same behavior for Office documents actually.
> {color}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)