All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.vpro.xml.bind.DateToXMLDate Maven / Gradle / Ivy

/*
 * Copyright (C) 2008 All rights reserved
 * VPRO The Netherlands
 */
package nl.vpro.xml.bind;

import java.util.Date;

import jakarta.xml.bind.annotation.adapters.XmlAdapter;

import org.apache.commons.lang3.time.FastDateFormat;

public class DateToXMLDate extends XmlAdapter {

    private static final FastDateFormat DF = FastDateFormat.getInstance("yyyy-MM-dd");

    @Override
    public Date unmarshal(String date) throws Exception {
        return DF.parse(date);
    }

    @Override
    public String marshal(Date date) {
        return DF.format(date);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy