List of usage examples for javax.xml.datatype XMLGregorianCalendar getMonth
public abstract int getMonth();
From source file:se.skl.skltpservices.npoadapter.mapper.util.EHRUtil.java
/** * Returns a {@link Date} date and time representation. * * @param cal/* ww w . ja va2s . com*/ * the actual date and time. * @return the {@link Date} representation. */ public static Date toDate(XMLGregorianCalendar cal) { if (cal != null) { final Calendar c = Calendar.getInstance(); c.set(Calendar.DATE, cal.getDay()); c.set(Calendar.MONTH, cal.getMonth() - 1); c.set(Calendar.YEAR, cal.getYear()); c.set(Calendar.DAY_OF_MONTH, cal.getDay()); c.set(Calendar.HOUR_OF_DAY, cal.getHour()); c.set(Calendar.MINUTE, cal.getMinute()); c.set(Calendar.SECOND, cal.getSecond()); c.set(Calendar.MILLISECOND, cal.getMillisecond()); return c.getTime(); } return null; }