You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Michael Frid (JIRA)" <ji...@apache.org> on 2012/10/11 17:07:03 UTC

[jira] [Created] (AXIS2-5437) Wrong daylight when converting XML datetime string to Calendar

Michael Frid created AXIS2-5437:
-----------------------------------

             Summary: Wrong daylight when converting XML datetime string to Calendar
                 Key: AXIS2-5437
                 URL: https://issues.apache.org/jira/browse/AXIS2-5437
             Project: Axis2
          Issue Type: Bug
          Components: adb
    Affects Versions: 1.6.1, 1.5.5
            Reporter: Michael Frid


We use axis2 (1.5) client stub for response returning datetime data type.
The problem is that when string doesn't include the TZ information (i.e 2012-10-11T01:54:30.13) returned Calendar instance is missing daylight information (DST_OFFSET). Because of that wrong Date (with one hour advanced) is returned.

The problem tracks down to org.apache.axis2.databinding.utils.ConverterUtil, convertToDateTime() method. 
At the end, calendar.set(Calendar.DST_OFFSET, 0) statement is wrong.

In 1.6.1 I see the trial to fix the problem

            // set the day light offset only if the time zone is present
            if (source.length() > 19){
                calendar.set(Calendar.DST_OFFSET, 0);
            }

But, check for 19 is wrong when string includes the ms part
 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org