Here you can find the source of getLocalTimeFromXMLGregorianCalendar( XMLGregorianCalendar xgcal)
Parameter | Description |
---|---|
xgcal | a parameter |
public static String getLocalTimeFromXMLGregorianCalendar( XMLGregorianCalendar xgcal)
//package com.java2s; //License from project: Open Source License import java.util.Date; import java.util.GregorianCalendar; import java.util.TimeZone; import javax.xml.datatype.XMLGregorianCalendar; public class Main { /** String used for non-available data */ private static final String NOT_AVAILABLE = "NA"; /**// w w w.ja va 2s .com * Returns a time string of the form given by Date.toString() from the * specified XMLGregorianCalendar. If the input is null, then the value of * NOT_AVAILABLE is returned. * * @param xgcal * @return * @see #NOT_AVAILABLE */ public static String getLocalTimeFromXMLGregorianCalendar( XMLGregorianCalendar xgcal) { if (xgcal == null) { return NOT_AVAILABLE; } GregorianCalendar gcal = xgcal.toGregorianCalendar( TimeZone.getTimeZone("GMT"), null, null); // Get the date Date date = gcal.getTime(); return date.toString(); } }