You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@juneau.apache.org by James Bognar <ja...@apache.org> on 2017/02/25 19:36:23 UTC
Timezone issue in BeanContextPropertiesTest.testClassTransforms.
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?