Hi Rudy,

The schema date/time handling is inherently a mess, mostly because the
schema people were more concerned about what they wanted in documents
for human-readable text exchange than in data exchange between
applications. The deserializeDate method should set the Date value
correctly in UTC (which looks right to me - Thu Aug 14 20:00:00 EDT 1975
== Fri Aug 15 00:00:00 GMT 1975).

If you want better control over the date/time handling, please use the
methods added in 1.2.2 and documented on
http://jibx.sourceforge.net/binding/date-time.html These new methods
work with the Joda date/time classes, where are better able to represent
the range of date/time values defined in schema than the built-in Java
types. Or, for just the date handling you can switch to a java.sql.Date
which uses a different deserializer (deserializeSqlDate). This
deserializer does adjust to the local time zone, as required for
java.sql.Date.

  - Dennis

Dennis M. Sosnoski
XML and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117


On 10/10/2010 02:01 PM, Rudy Jadeja wrote:
> I am using the deserializeDate method for handling xsd:Date types.  I
> get a date of the form yyyy-mm-dd (i.e. 1975-08-15).  Given the date
> string 1975-08-15, the deserializeDate method returns the following
> java.Util.Date :  Thu Aug 14 20:00:00 EDT 1975.  I am expecting it to
> return August 15th, not 14th. 
>
> Looking around in the source code, line 707 is this :
>
> long day = parseDigits(text, split+4, 2) - 1;
>
> The parseDigits method returns the proper date (15) but the -1 here
> changes it to 14.  I don't know if this is an error or if this is by
> design.  I found a bug report mentioning the same issue :
> http://jira.codehaus.org/browse/JIBX-209
>
> but in the resolution was that it could not be reproduced.
>
> I am using JiBX version 1.2.2
>
> Thank you,
> Rudy Jadeja
>
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today.
> http://p.sf.net/sfu/beautyoftheweb
>
>
> _______________________________________________
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>   
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to