[
http://jira.codehaus.org/browse/JIBX-209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=131457#action_131457
]
Dennis Sosnoski commented on JIBX-209:
--------------------------------------
Oh, and note that the conversion used by default for java.sql.Date *does* add
the appropriate bias for the local time zone, as required by the java.sql.Date
specification - so if you want dates converted to your local zone, just use the
java.sql.Date type (or wrap these methods with your own
serializer/deserializers).
> serializeDate and deserializeDate are one day off
> -------------------------------------------------
>
> Key: JIBX-209
> URL: http://jira.codehaus.org/browse/JIBX-209
> Project: JiBX
> Issue Type: Bug
> Components: core
> Affects Versions: JiBX 1.1.5
> Reporter: Ryan Senior
> Assignee: Dennis Sosnoski
> Priority: Minor
> Fix For: JiBX 1.1.6
>
> Attachments: starter.zip
>
>
> When using the Date serializer/deserializer:
> <format type="java.util.Date"
> deserializer="org.jibx.runtime.Utility.deserializeDate"
> serializer="org.jibx.runtime.Utility.serializeDate"/>
> it is actually one day off. When deserializing a date, it subtracts a day
> and when serializing it adds a day. Attached is example code of this, but
> basically the problem is on line 652 of Utility.java:
> long day = parseDigits(text, split+4, 2) - 1;
> which converts 2008/03/11 to 2008/03/10. It looks like it will also add a
> day when deserializing it (line 1121 of Utility.java) :
> int day = (int)(extra / MSPERDAY) + 1;
> The attached code is a modified version of the starter application to include
> a date and throws an exception if the date is a day off.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs