package com.manning.siia.domain.binding;

import org.joda.time.DateTime;

import javax.xml.bind.annotation.adapters.XmlAdapter;
import java.util.Date;

/**
 * @author Jonas Partner
 *
 */
public class JodaDateTimeBinder extends XmlAdapter<Date, DateTime> {
    @Override
    public DateTime unmarshal(Date v) throws Exception {
        return new DateTime(v.getTime());
    }

    @Override
    public Date marshal(DateTime v) throws Exception {
        return new Date(v.getMillis());
    }
}

@@ -56,24 +56,100 @@
 da.time.
-DateTime
+Chronology;%0Aimport org.joda.time.DateTime;%0Aimport org.joda.time.chrono.ISOChronology
 ;%0A%0Aimpor
@@ -436,16 +436,48 @@
 etTime()
+, ISOChronology.getInstanceUTC()
 );%0A    %7D

set converter use UTC for DateTime