axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefano Ghezzi (JIRA)" <>
Subject [jira] [Created] (AXIS2-5726) One hour difference after convertToDateTime
Date Mon, 12 Oct 2015 15:07:05 GMT
Stefano Ghezzi created AXIS2-5726:

             Summary: One hour difference after convertToDateTime
                 Key: AXIS2-5726
             Project: Axis2
          Issue Type: Bug
          Components: databinding
    Affects Versions: 1.6.3
            Reporter: Stefano Ghezzi

I find a difference of one hour between the date coming from the client and the date returned
by the axis2 system.
Debugging inside the code i get to the method 


which seems responsible of the conversion from string to date

This is the snipped from the ws call


The field was declared as dateTime

          <s:element minOccurs="1" maxOccurs="1" name="D_ULT_AGGM" type="s:dateTime" />

This is the test program

package test;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Axis2DateBug {

        public static void main(String[] args) {

            String date = "2015-07-03T09:58:37";
            Calendar cal = org.apache.axis2.databinding.utils.ConverterUtil.convertToDateTime(date);
            Date d = cal.getTime();
            SimpleDateFormat itaDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss");

            System.out.println("prev=" + date);
            System.out.println(" new="+itaDateFormat.format(d));

            // result
            // new=2015-07-03T10:58:37


The output date has an hour gain from the original hour. I suspect this could be related to
timezone but i can't understand how to overcome the problem. Is this an axis2 bug of there
is something i could do to get out the correct date?

Thanks in advance

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message