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 F. Medric II (JIRA)" <ji...@apache.org> on 2007/08/02 18:50:52 UTC

[jira] Created: (AXIS2-3059) Date gets changed for xsd:date types

Date gets changed for xsd:date types
------------------------------------

                 Key: AXIS2-3059
                 URL: https://issues.apache.org/jira/browse/AXIS2-3059
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: adb
    Affects Versions: 1.3
         Environment: Java 5.0 Windows XP
            Reporter: Michael F. Medric II


I have an attribute of type xsd:date in my WSDL and have generated ADBBean objects via wsdl2java.  This xsd:date attribute maps to a DateTime field in our database.  However, our system only cares about the date part (month, day, year), not the time.  As a result, the dates are stored with time 00:00:00 in the database.  When querying for this object using axis2, it moves the day back one day because of the UTC conversion that is done in ConvertUtil.convertToDate(String).  

For instance, the say the date is '2000-01-01 00:00:00' in the database.  The client is in GMT-5:00 time zone.  What is returned to the client is '1999-12-31 19:00:00'.  Essentially, it seems the day will always get shifted as per the client time zone by way of the ConvertUtil.convertToString(Date) method that always assumes GMT (which appends 'Z' to  the serialized date).  It seems to me that the use of xsd:date is undermined here because the day will get always get shifted back for any client timezones behind GMT.  I'm not sure if this is a bug or by design but it seems worth mentioning.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (AXIS2-3059) Date gets changed for xs:date types

Posted by "Lars Kruse Pedersen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536830 ] 

Lars Kruse Pedersen commented on AXIS2-3059:
--------------------------------------------

Thanks for the fix, but...
Isn't there supposed to be a colon in the zone offset part, like 02:00, using Z will produce 0200?!? And how do one get a timezone neutral date(without the zone offset part), using GMT produces +0000...

> Date gets changed for xs:date types
> -----------------------------------
>
>                 Key: AXIS2-3059
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3059
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.3
>         Environment: Java 5.0 Windows XP
>            Reporter: Michael Medric
>            Assignee: Amila Chinthaka Suriarachchi
>
> I have an attribute of type xs:date in my WSDL and have generated ADBBean objects via wsdl2java.  This xs:date attribute maps to a DateTime field in our database.  However, our system only cares about the date part (month, day, year), not the time.  As a result, the dates are stored with time 00:00:00 in the database.  When querying for this object using axis2, it moves the day back one day because of the UTC conversion that is done in ConvertUtil.convertToDate(String).  
> For instance, the say the date is '2000-01-01 00:00:00' in the database.  The client is in GMT-5:00 time zone.  What is returned to the client is '1999-12-31 19:00:00'.  Essentially, it seems the day will always get shifted as per the client time zone by way of the ConvertUtil.convertToString(Date) method that always assumes GMT (which appends 'Z' to  the serialized date).  It seems to me that the use of xsd:date is undermined here because the day will get always get shifted back for any client timezones behind GMT.  I'm not sure if this is a bug or by design but it seems worth mentioning.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (AXIS2-3059) Date gets changed for xs:date types

Posted by "Michael Medric (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Medric updated AXIS2-3059:
----------------------------------

    Description: 
I have an attribute of type xs:date in my WSDL and have generated ADBBean objects via wsdl2java.  This xs:date attribute maps to a DateTime field in our database.  However, our system only cares about the date part (month, day, year), not the time.  As a result, the dates are stored with time 00:00:00 in the database.  When querying for this object using axis2, it moves the day back one day because of the UTC conversion that is done in ConvertUtil.convertToDate(String).  

For instance, the say the date is '2000-01-01 00:00:00' in the database.  The client is in GMT-5:00 time zone.  What is returned to the client is '1999-12-31 19:00:00'.  Essentially, it seems the day will always get shifted as per the client time zone by way of the ConvertUtil.convertToString(Date) method that always assumes GMT (which appends 'Z' to  the serialized date).  It seems to me that the use of xsd:date is undermined here because the day will get always get shifted back for any client timezones behind GMT.  I'm not sure if this is a bug or by design but it seems worth mentioning.

  was:
I have an attribute of type xsd:date in my WSDL and have generated ADBBean objects via wsdl2java.  This xsd:date attribute maps to a DateTime field in our database.  However, our system only cares about the date part (month, day, year), not the time.  As a result, the dates are stored with time 00:00:00 in the database.  When querying for this object using axis2, it moves the day back one day because of the UTC conversion that is done in ConvertUtil.convertToDate(String).  

For instance, the say the date is '2000-01-01 00:00:00' in the database.  The client is in GMT-5:00 time zone.  What is returned to the client is '1999-12-31 19:00:00'.  Essentially, it seems the day will always get shifted as per the client time zone by way of the ConvertUtil.convertToString(Date) method that always assumes GMT (which appends 'Z' to  the serialized date).  It seems to me that the use of xsd:date is undermined here because the day will get always get shifted back for any client timezones behind GMT.  I'm not sure if this is a bug or by design but it seems worth mentioning.

        Summary: Date gets changed for xs:date types  (was: Date gets changed for xsd:date types)

> Date gets changed for xs:date types
> -----------------------------------
>
>                 Key: AXIS2-3059
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3059
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.3
>         Environment: Java 5.0 Windows XP
>            Reporter: Michael Medric
>            Assignee: Amila Chinthaka Suriarachchi
>
> I have an attribute of type xs:date in my WSDL and have generated ADBBean objects via wsdl2java.  This xs:date attribute maps to a DateTime field in our database.  However, our system only cares about the date part (month, day, year), not the time.  As a result, the dates are stored with time 00:00:00 in the database.  When querying for this object using axis2, it moves the day back one day because of the UTC conversion that is done in ConvertUtil.convertToDate(String).  
> For instance, the say the date is '2000-01-01 00:00:00' in the database.  The client is in GMT-5:00 time zone.  What is returned to the client is '1999-12-31 19:00:00'.  Essentially, it seems the day will always get shifted as per the client time zone by way of the ConvertUtil.convertToString(Date) method that always assumes GMT (which appends 'Z' to  the serialized date).  It seems to me that the use of xsd:date is undermined here because the day will get always get shifted back for any client timezones behind GMT.  I'm not sure if this is a bug or by design but it seems worth mentioning.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Resolved: (AXIS2-3059) Date gets changed for xs:date types

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amila Chinthaka Suriarachchi resolved AXIS2-3059.
-------------------------------------------------

    Resolution: Fixed

instead of converting the date to the GMT now it adds the local time which is the recovarable timezone. Now converToString(date) method looks like this,
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-ddZ");
        return simpleDateFormat.format(value);

> Date gets changed for xs:date types
> -----------------------------------
>
>                 Key: AXIS2-3059
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3059
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.3
>         Environment: Java 5.0 Windows XP
>            Reporter: Michael Medric
>            Assignee: Amila Chinthaka Suriarachchi
>
> I have an attribute of type xs:date in my WSDL and have generated ADBBean objects via wsdl2java.  This xs:date attribute maps to a DateTime field in our database.  However, our system only cares about the date part (month, day, year), not the time.  As a result, the dates are stored with time 00:00:00 in the database.  When querying for this object using axis2, it moves the day back one day because of the UTC conversion that is done in ConvertUtil.convertToDate(String).  
> For instance, the say the date is '2000-01-01 00:00:00' in the database.  The client is in GMT-5:00 time zone.  What is returned to the client is '1999-12-31 19:00:00'.  Essentially, it seems the day will always get shifted as per the client time zone by way of the ConvertUtil.convertToString(Date) method that always assumes GMT (which appends 'Z' to  the serialized date).  It seems to me that the use of xsd:date is undermined here because the day will get always get shifted back for any client timezones behind GMT.  I'm not sure if this is a bug or by design but it seems worth mentioning.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Assigned: (AXIS2-3059) Date gets changed for xsd:date types

Posted by "Deepal Jayasinghe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Deepal Jayasinghe reassigned AXIS2-3059:
----------------------------------------

    Assignee: Amila Chinthaka Suriarachchi

> Date gets changed for xsd:date types
> ------------------------------------
>
>                 Key: AXIS2-3059
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3059
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.3
>         Environment: Java 5.0 Windows XP
>            Reporter: Michael F. Medric II
>            Assignee: Amila Chinthaka Suriarachchi
>
> I have an attribute of type xsd:date in my WSDL and have generated ADBBean objects via wsdl2java.  This xsd:date attribute maps to a DateTime field in our database.  However, our system only cares about the date part (month, day, year), not the time.  As a result, the dates are stored with time 00:00:00 in the database.  When querying for this object using axis2, it moves the day back one day because of the UTC conversion that is done in ConvertUtil.convertToDate(String).  
> For instance, the say the date is '2000-01-01 00:00:00' in the database.  The client is in GMT-5:00 time zone.  What is returned to the client is '1999-12-31 19:00:00'.  Essentially, it seems the day will always get shifted as per the client time zone by way of the ConvertUtil.convertToString(Date) method that always assumes GMT (which appends 'Z' to  the serialized date).  It seems to me that the use of xsd:date is undermined here because the day will get always get shifted back for any client timezones behind GMT.  I'm not sure if this is a bug or by design but it seems worth mentioning.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (AXIS2-3059) Date gets changed for xs:date types

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536955 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-3059:
-----------------------------------------------------

fixed the issue
now you can give a custom converterUtil class (with the same method signature) to serialize the date and datetime.
the following system property can be used to set your custom class.
public static final String SYSTEM_PROPERTY_ADB_CONVERTERUTIL = "adb.converterutil";



> Date gets changed for xs:date types
> -----------------------------------
>
>                 Key: AXIS2-3059
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3059
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.3
>         Environment: Java 5.0 Windows XP
>            Reporter: Michael Medric
>            Assignee: Amila Chinthaka Suriarachchi
>
> I have an attribute of type xs:date in my WSDL and have generated ADBBean objects via wsdl2java.  This xs:date attribute maps to a DateTime field in our database.  However, our system only cares about the date part (month, day, year), not the time.  As a result, the dates are stored with time 00:00:00 in the database.  When querying for this object using axis2, it moves the day back one day because of the UTC conversion that is done in ConvertUtil.convertToDate(String).  
> For instance, the say the date is '2000-01-01 00:00:00' in the database.  The client is in GMT-5:00 time zone.  What is returned to the client is '1999-12-31 19:00:00'.  Essentially, it seems the day will always get shifted as per the client time zone by way of the ConvertUtil.convertToString(Date) method that always assumes GMT (which appends 'Z' to  the serialized date).  It seems to me that the use of xsd:date is undermined here because the day will get always get shifted back for any client timezones behind GMT.  I'm not sure if this is a bug or by design but it seems worth mentioning.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (AXIS2-3059) Date gets changed for xs:date types

Posted by "Ryan Moffat (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12522910 ] 

Ryan Moffat commented on AXIS2-3059:
------------------------------------

We are experiencing exactly the same issue on our project. We are not confident enough of the date specifications to assess whether or not this is bug, but it certainly alters behaviour from version 1.1.1 to 1.1.2 breaking existing functionality.

Can someone shed any light on this issue?

Thanks
Ryan

> Date gets changed for xs:date types
> -----------------------------------
>
>                 Key: AXIS2-3059
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3059
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.3
>         Environment: Java 5.0 Windows XP
>            Reporter: Michael Medric
>            Assignee: Amila Chinthaka Suriarachchi
>
> I have an attribute of type xs:date in my WSDL and have generated ADBBean objects via wsdl2java.  This xs:date attribute maps to a DateTime field in our database.  However, our system only cares about the date part (month, day, year), not the time.  As a result, the dates are stored with time 00:00:00 in the database.  When querying for this object using axis2, it moves the day back one day because of the UTC conversion that is done in ConvertUtil.convertToDate(String).  
> For instance, the say the date is '2000-01-01 00:00:00' in the database.  The client is in GMT-5:00 time zone.  What is returned to the client is '1999-12-31 19:00:00'.  Essentially, it seems the day will always get shifted as per the client time zone by way of the ConvertUtil.convertToString(Date) method that always assumes GMT (which appends 'Z' to  the serialized date).  It seems to me that the use of xsd:date is undermined here because the day will get always get shifted back for any client timezones behind GMT.  I'm not sure if this is a bug or by design but it seems worth mentioning.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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