List of utility methods to do XML Date Create
String | getXMLDateString() get XML Date String return getXMLDateString(0);
|
String | getXMLDateStringFromDouble(double d) Used for export (writes XML date strings). if (d == Double.NEGATIVE_INFINITY) { return "-Infinity"; } else if (d == Double.POSITIVE_INFINITY) { return "Infinity"; GregorianCalendar gc = new GregorianCalendar(); gc.setTimeInMillis((long) d); return dateFactory.newXMLGregorianCalendar(gc).toXMLFormat().substring(0, 23); ... |
XMLGregorianCalendar | getXMLDateTime(Date date) A new method, that contains the code previously present in the above method, that is, to create an XML GC Object with both the Date and time component. GregorianCalendar gCal = new GregorianCalendar(); if (date != null) { gCal.setTime(date); XMLGregorianCalendar xgCal = DatatypeFactory.newInstance().newXMLGregorianCalendar(gCal); return xgCal; } else { return null; |
String | getXMLFormat(Calendar calendar) get XML Format GregorianCalendar greg = new GregorianCalendar(Locale.US); greg.setTime(calendar.getTime()); greg.setTimeZone(calendar.getTimeZone()); XMLGregorianCalendar xmlCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(greg); return xmlCalendar.toXMLFormat(); |
XMLGregorianCalendar | getXmlGregCal(Date dt) get Xml Greg Cal GregorianCalendar gc = new GregorianCalendar(); gc.setTime(dt); XMLGregorianCalendar xgc = DatatypeFactory.newInstance().newXMLGregorianCalendar(gc); return xgc; |
XMLGregorianCalendar | getXMLGregorianCalendar() get XML Gregorian Calendar try { GregorianCalendar gcal = new GregorianCalendar(); return DatatypeFactory.newInstance().newXMLGregorianCalendar(gcal); } catch (DatatypeConfigurationException e1) { e1.printStackTrace(); return null; |
XMLGregorianCalendar | getXMLGregorianCalendar(Date date) get XML Gregorian Calendar GregorianCalendar cal = new GregorianCalendar(); cal.setTime(date); return getDatatypeFactory().newXMLGregorianCalendar(cal); |
XMLGregorianCalendar | getXMLGregorianCalendar(Date date) get XML Gregorian Calendar GregorianCalendar cal = (GregorianCalendar) GregorianCalendar.getInstance();
cal.setTime(date);
return DatatypeFactory.newInstance().newXMLGregorianCalendar(cal);
|
XMLGregorianCalendar | getXmlGregorianCalendar(String unixTime) Turns a string representation of unix time into a XMLGregorianCalendar. return getXmlGregorianCalendar(getDate(unixTime));
|
XMLGregorianCalendar | getXMLGregorianCalendar(TimeZone timeZone, Locale locale) get XML Gregorian Calendar return DatatypeFactory.newInstance().newXMLGregorianCalendar(getGregorianCalendar(timeZone, locale));
|