[jboss-jira] [JBoss JIRA] Created: (JBXB-143) Invalid marshalling of dateTime Timezone
Darran Lofthouse (JIRA)
jira-events at lists.jboss.org
Thu May 22 09:48:09 EDT 2008
Invalid marshalling of dateTime Timezone
----------------------------------------
Key: JBXB-143
URL: http://jira.jboss.com/jira/browse/JBXB-143
Project: JBoss XML Binding (JBossXB)
Issue Type: Bug
Affects Versions: JBossXB-1.0.0.SP2, JBossXB-2.0.0.CR9
Reporter: Darran Lofthouse
Assigned To: Darran Lofthouse
Fix For: JBossXB-2.0.0.CR10, JBossXB-1.0.0.SP3
The following class: -
http://anonsvn.jboss.org/repos/common/jbossxb/trunk/src/main/java/org/jboss/xb/binding/SimpleTypeBindings.java
Converts the timezone to a String as: -
private static String marshalTimeZone(Calendar value)
{
int offset = value.get(Calendar.ZONE_OFFSET) + value.get(Calendar.DST_OFFSET);
if(offset == 0)
{
return "Z";
}
DecimalFormat hourFormat = new DecimalFormat("'+'00;-00");
DecimalFormat minuteFormat = new DecimalFormat("00");
int minutes = offset / (1000 * 60);
int hours = minutes / 60;
minutes -= (hours * 60);
return hourFormat.format(hours) + ":" + minuteFormat.format(minutes);
}
The get methods return a time in milliseconds but the code assumes it is returned in hours.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list