@Override public String toString() { return ISO8601Converter.formatTime( this ); } }
@Override public String toString() { return formatDate( this ); } }
@Override public String toString() { return formatDuration( this ); } }
@Deprecated public static String formatDateTime( java.util.Date date ) { return formatDateTime( new DateTime( date, GMT ) ); }
private String encodeTemporal( final Temporal t1 ) { return formatDateTime( t1 ); }
public Temporal convert( final String gmlTimePositionUnion ) { return parseDateTime( gmlTimePositionUnion ); }
/** * 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 ); }
protected DateTime getCurrentDateTimeWithoutMilliseconds() { long msSince1970 = new Date().getTime(); msSince1970 = msSince1970 / 1000 * 1000; return new DateTime( new Date( msSince1970 ), GMT ); }
@Deprecated public static String formatDate( final java.util.Date date ) { return formatDate( new org.deegree.commons.tom.datetime.Date( date, GMT ) ); }
/** * 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: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 ); }
@Override public Date toTimeZone( TimeZone tz ) { Calendar cal = null; if ( tz == null ) { cal = getInstance(); } else { cal = getInstance( tz ); } cal.setTimeInMillis( this.cal.getTimeInMillis() ); return new Date( cal, tz == null ); }
@Override public String toString() { return printDateTime( getCalendar() ); } }
public TimeGeometricPrimitive createPeriodOrInstant( final Temporal begin, final Temporal end ) { if ( begin != null && begin.equals( end ) ) { return createInstant( begin ); } return createPeriod( begin, end ); }
@Override public Time toTimeZone( TimeZone tz ) { Calendar cal = null; if ( tz == null ) { cal = getInstance(); } else { cal = getInstance( tz ); } cal.setTimeInMillis( this.cal.getTimeInMillis() ); return new Time( cal, tz == null ); }
/** * Returns optional additional human-readable text associated with the starting of the process execution. * * @return optional additional human-readable text, null if it is not available */ public String getStartMessage() { if ( startedMessage == null ) { return "Process execution started@" + ISO8601Converter.formatDateTime( new Date( startTime ) ); } return startedMessage; }
@Override public DateTime toTimeZone( TimeZone tz ) { Calendar cal = null; if ( tz == null ) { cal = getInstance(); } else { cal = getInstance( tz ); } cal.setTimeInMillis( this.cal.getTimeInMillis() ); return new DateTime( cal, tz == null ); }
private boolean equalsParsed( final String v1, final String v2 ) { try { final Temporal d1 = new TemporalConverter().convert( v1 ); final Temporal d2 = new TemporalConverter().convert( v2 ); return d1.equals( d2 ); } catch ( IllegalArgumentException e ) { // nothing to do } return false; }
/** * Returns optional additional human-readable text associated with the successful finishing of the process * execution. * * @return optional additional human-readable text, null if it is not available */ public String getSucceededMessage() { if ( succeededMessage == null && finishTime >= 0 ) { return "Process execution succeeded@" + ISO8601Converter.formatDateTime( new Date( finishTime ) ); } return succeededMessage; }
protected String getTimestamp() { DateTime dateTime = getCurrentDateTimeWithoutMilliseconds(); return ISO8601Converter.formatDateTime( dateTime ); }