juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Bognar <jamesbog...@apache.org>
Subject Timezone issue in BeanContextPropertiesTest.testClassTransforms.
Date Sat, 25 Feb 2017 19:36:23 GMT
Hey Stian,

I'm looking at that timezone issue you reported and I'm a bit stumped.

Here's what you reported....



* BeanContextPropertiesTest.testClassTransforms:33expected:<d1=2001-07-04T1[5:30:45Z,...]>
but
was:<d1=2001-07-04T1[6:30:45+01:00,...]>*

The output from this test should always be in Zulu time, not '+01:00'.

The code being tested is the *DateSwap.ISO8601DTZ.swap()* method shown
below which *should* always convert to Zulu time...

public String swap(BeanSession session, Date o) {
   Calendar c = new GregorianCalendar();
   c.setTime(o);

   if (c.getTimeZone().getRawOffset() != 0) {
      Calendar c2 = Calendar.getInstance(GMT);
      c2.setTime(c.getTime());
      c = c2;
   }

   return DatatypeConverter.printDateTime(c);
}
Any idea what the issue could be?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message