Tika
  1. Tika
  2. TIKA-902

Problem with TimeZone when update poi to 3.8 from 3.6

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I use poi version 3.6
      When i update to version 3.8 i have problem with date
      for example creation date document

      In poi 3.6 version i can see a code:
      SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
      Date d = df.parse(s, new ParsePosition(0));
      In poi 3.7 and 3.8 version i can see a code:
      SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
      df.setTimeZone(TimeZone.getTimeZone("UTC"));
      Date d = df.parse(s, new ParsePosition(0));

      so if we extract date as String s = "2010-08-31T07:53:00Z" and, as mentiond above, it will be formatted as set pattern.
      But since timezone is hardcoded and set to "UTC", the date is treated as 2010-08-31 07:53:00 in UTC timezone.
      So, in our (UTC+3) time zone the date will be "2010-08-31T10:53:00Z" and that seems to be not correct.

      P.S.
      I'm not sure if this issue has been created in the correct project.
      Please, move it in the correct project if needed, or explain where it should be created.

        Activity

        Hide
        Andrey Plotnikov added a comment -

        Thanks

        Show
        Andrey Plotnikov added a comment - Thanks
        Hide
        Nick Burch added a comment -

        POI bugs should be reported on the POI bugzilla - http://issues.apache.org/bugzilla/buglist.cgi?product=POI

        However, the Z on the end of your date means that the date really is in UTC, so setting the timezone is correct. If you want to specify that your date is in UTC+3, you must put +03:00 on the end rather than Z, that's how ISO-8601 works

        Show
        Nick Burch added a comment - POI bugs should be reported on the POI bugzilla - http://issues.apache.org/bugzilla/buglist.cgi?product=POI However, the Z on the end of your date means that the date really is in UTC, so setting the timezone is correct. If you want to specify that your date is in UTC+3, you must put +03:00 on the end rather than Z, that's how ISO-8601 works

          People

          • Assignee:
            Unassigned
            Reporter:
            Andrey Plotnikov
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development