Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-864

EdmDate and EdmTimeOfDay output in local timezone

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • (Java) V4 4.0.0-beta-01
    • (Java) V4 4.2.0
    • odata4-commons
    • None

    Description

      EdmDate and EdmTimeOfDay both assume GMT for incoming string values - however when the convert from Java objects to string they use the local/default Calendar.

      OData TC says parsing Date or Time should be exactly same in every time zone.

      This highlights the issue with EdmDate:
      TimeZone.setDefault(TimeZone.getTimeZone("GMT-1"));
      java.sql.Timestamp date = EdmDate.getInstance().valueOfString("2000-01-01", true, 4000, 0, 0, true, java.sql.Timestamp.class);
      assertEquals("1999-12-31 23:00:00.0", date.toString());
      String val = EdmDate.getInstance().valueToString(date, true, 4000, 0, 0, true);
      assertEquals("2000-01-01", date.toString());
      The last line fails because the date will be "1999-12-31" instead.

      Linked issue at https://issues.jboss.org/browse/TEIID-3938

      Attachments

        Issue Links

          Activity

            People

              rareddy Ramesh Reddy
              rareddy Ramesh Reddy
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: