/** * Parses the given <code>xs:time</code> string. * * @param xsTime * the <code>xs:time/code> to be parsed, must not be <code>null</code> * @return the parsed date, never <code>null</code> (available timezone information is kept) * @throws IllegalArgumentException * if parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for * <code>xs:date</code> */ public static Time parseTime( final String xsTime ) throws IllegalArgumentException { Calendar cal = DatatypeConverter.parseTime( xsTime ); boolean isTimeZoneUnknown = isLocal( xsTime ); return new Time( cal, isTimeZoneUnknown ); }
/** * Parses the given <code>xs:date</code> string. * * @param xsDate * the <code>xs:date</code> to be parsed, must not be <code>null</code> * @return the parsed date, never <code>null</code> (available timezone information is kept) * @throws IllegalArgumentException * if parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for * <code>xs:date</code> */ public static Date parseDate( final String xsDate ) throws IllegalArgumentException { Calendar cal = DatatypeConverter.parseDate( xsDate ); boolean isTimeZoneUnknown = isLocal( xsDate ); return new org.deegree.commons.tom.datetime.Date( cal, isTimeZoneUnknown ); }
/** * Parses the given <code>xs:dateTime</code> string. * * @param xsDateTime * the <code>xs:dateTime</code> to be parsed, must not be <code>null</code> * @return the parsed date, never <code>null</code> (available timezone information is kept) * @throws IllegalArgumentException * if parameter does not conform to lexical value space defined in XML Schema Part 2: Datatypes for * <code>xs:dateTime</code> */ public static DateTime parseDateTime( final String xsDateTime ) throws IllegalArgumentException { Calendar cal = DatatypeConverter.parseDateTime( xsDateTime ); boolean isTimeZoneUnknown = isLocal( xsDateTime ); return new DateTime( cal, isTimeZoneUnknown ); }