Title: Unmarshaling dates

I'm brand new to JiBX and am trying to get a small sample working and have a weird date marshaling problem. 

My XML looks like this:

<Disbursement Number="1">
        <DisbursementDate>2003-07-01</DisbursementDate>
        <!-- more fields here ... -->
</Disbursement>

My Binding XML looks like this:

<binding>
        <mapping name="Disbursement" class="Disbursement">
                <value name="DisbursementDate" field="actualDate" format="SqlDate:default"/>
                <!-- More value tags here to match XML -->
        </mapping>
</binding>

and my java source has the "actualDate" field defined as a java.util.Date.

When I load the XML into a sample program and run the code:
System.out.println("Date: " + disb.getActualDate());

I get the output of
Date: 2003-06-30


But my input date was July 1, 2003.  Whatever I use for a date the output is one day earlier.  If I marshal the object back into XML and then write that the correct value is back (2003-07-01).

What am I doing wrong?

Thanks,
Tim

Reply via email to