package org.jeecg.modules.mdc.util; import javax.xml.bind.annotation.adapters.XmlAdapter; import java.text.SimpleDateFormat; import java.util.Date; /** * @author Lius * @date 2024/6/13 9:54 */ public class DateAdapter extends XmlAdapter { private static final SimpleDateFormat SDF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @Override public Date unmarshal(String date) throws Exception { return SDF.parse(date); } @Override public String marshal(Date date) throws Exception { return SDF.format(date); } }