Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5494

Date conversion does not handle timzone offset correctly for date strings containing seconds

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.2
    • None
    • databinding
    • None

    Description

      The date format containing seconds and timezone offset as follows generates an exception:

      yyyy-MM-dd'T'hh:mm:ssZ

      e.g.:

      2013-03-04T15:07:14+11:00

      The web service call fails with the exception:

      Caused by: java.lang.IllegalArgumentException: ZONE_OFFSET
      at java.util.GregorianCalendar.computeTime(GregorianCalendar.java:2316)
      at java.util.Calendar.updateTime(Calendar.java:2469)
      at java.util.Calendar.getTimeInMillis(Calendar.java:1088)
      at org.apache.axis2.databinding.utils.ConverterUtil.convertToDate(ConverterUtil.java:623)

      ConvertUtil.java line 596:

      int hours = Integer.parseInt(restpart.substring(1,3));
      int minits = Integer.parseInt(restpart.substring(4,6));
      timeZoneOffSet = ((hours * 60) + minits) * 60000;

      Attachments

        Activity

          People

            Unassigned Unassigned
            drhee David Rhee
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: