private String encodeTemporal( final Temporal t1 ) { return formatDateTime( t1 ); }
public Temporal convert( final String gmlTimePositionUnion ) { return parseDateTime( gmlTimePositionUnion ); }
DimensionInterval<?, ?, ?> iv = (DimensionInterval<?, ?, ?>) o; if ( time ) { sb.append( formatDateTime( (Date) iv.min ) ).append( "/" ); if ( iv.max instanceof Date ) { sb.append( formatDateTime( (Date) iv.max ) ).append( "/" ); } else { sb.append( "current/" ); sb.append( formatDuration( (Duration) iv.res ) ); sb.append( formatDateTime( (Temporal) o ) ); } else { sb.append( o );
String date = result.getString( 1 ); if ( date != null ) { lastInserted = parseDateTime( date ).getDate(); ir.addPreparedArgument( new SQLIdentifier( "value" ), ISO8601Converter.formatDateTime( new Date() ) ); ir.performInsert( conn );
value = parseDate( s ); break; value = parseDateTime( s ); break; value = parseTime( s ); } catch ( Exception e ) { String msg = "Value ('" + s + "') is not valid with respect to the xs:time type.";
case DATE: if ( o instanceof Date ) { xml = "" + formatDate( (Temporal) o ); } else { LOG.warn( "Unhandled Date class " + o.getClass() + " -- converting via #toString()" ); case DATE_TIME: if ( o instanceof DateTime ) { xml = "" + formatDateTime( (Temporal) o ); } else { LOG.warn( "Unhandled Date class " + o.getClass() + " -- converting via #toString()" ); case TIME: { if ( o instanceof Time ) { xml = "" + formatTime( (Temporal) o ); } else { LOG.warn( "Unhandled Date class " + o.getClass() + " -- converting via #toString()" );
DimensionInterval<?, ?, ?> iv = (DimensionInterval<?, ?, ?>) o; if ( time ) { Date min = parseDateTime( (String) iv.min ).getDate(); Date max; if ( ( (String) iv.max ).equalsIgnoreCase( "current" ) ) { max = new Date(); } else { max = parseDateTime( (String) iv.max ).getDate(); return new DimensionInterval<Date, Date, Duration>( min, max, parseDuration( (String) iv.res ) );
/** * TODO handling of SQL timezone * * @param input * @return */ protected java.sql.Date toSqlDate( Object input ) { if ( input instanceof java.sql.Date ) { return (java.sql.Date) input; } java.sql.Date value = null; if ( input instanceof java.util.Date ) { java.util.Date date = (java.util.Date) input; value = new java.sql.Date( date.getTime() ); } else if ( input instanceof Temporal ) { Temporal timeInstant = (Temporal) input; value = new java.sql.Date( timeInstant.getTimeInMilliseconds() ); } else { String s = input.toString(); Date timeInstant = parseDate( s ); value = toSqlDate( timeInstant ); } return value; }
@Override public String toString() { return formatDuration( this ); } }
@Override public String toString() { return formatDate( this ); } }
result = new Pair<Object, Object>( value1, XMLValueMangler.xmlToInternal( value2.toString(), BOOLEAN ) ); } else if ( value1 instanceof Date ) { result = new Pair<Object, Object>( value1, parseDate( value2.toString() ) ); } else if ( value1 instanceof DateTime ) { result = new Pair<Object, Object>( value1, parseDateTime( value2.toString() ) ); } else if ( value1 instanceof Time ) { result = new Pair<Object, Object>( value1, parseTime( value2.toString() ) ); } else if ( value1 instanceof CodeType ) { result = new Pair<Object, Object>( value1, new CodeType( value2.toString(), result = new Pair<Object, Object>( XMLValueMangler.xmlToInternal( value1.toString(), BOOLEAN ), value2 ); } else if ( value2 instanceof Date ) { result = new Pair<Object, Object>( parseDate( value1.toString() ), value2 ); } else if ( value2 instanceof DateTime ) { result = new Pair<Object, Object>( parseDateTime( value1.toString() ), value2 ); } else if ( value2 instanceof Time ) { result = new Pair<Object, Object>( parseTime( value1.toString() ), value2 ); } else if ( value1 instanceof CodeType ) { result = new Pair<Object, Object>( new CodeType( value1.toString(),
try { if ( revisionDateString != null && !"".equals( revisionDateString ) ) { date = parseDate( revisionDateString ); } else { date = null; try { if ( creationDateString != null && !"".equals( creationDateString ) ) { date = parseDate( creationDateString ); } else { date = null; try { if ( publicationDateString != null && !"".equals( publicationDateString ) ) { date = parseDate( publicationDateString ); } else { date = null;
@Deprecated public static String formatDate( final java.util.Date date ) { return formatDate( new org.deegree.commons.tom.datetime.Date( date, GMT ) ); }
/** * 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; }
private void parseAndAddTime( XMLStreamReader in, Map<String, List<?>> dimensions ) throws XMLStreamException { QName time = new QName( SLDNS, "Time" ); if ( in.getName().equals( time ) ) { String timeValue = getText( in, time, null, true ); if ( timeValue != null ) { DateTime parsedDateTime = ISO8601Converter.parseDateTime( timeValue ); dimensions.put( "time", Arrays.asList( parsedDateTime ) ); } } }
dateSpecificationDate = parseDate( specificationDateString );
/** * 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; }
@SuppressWarnings("unchecked") @Override public <T> TypedObjectNode[] evaluate( T obj, XPathEvaluator<T> xpathEvaluator ) throws FilterEvaluationException { StringBuffer sb = new StringBuffer( dateValue.toString().trim() ); if ( dateValueContn != null ) { dateValueContn.evaluate( sb, (Feature) obj, (XPathEvaluator<Feature>) xpathEvaluator ); } try { DateTime value = ISO8601Converter.parseDateTime( sb.toString().trim() ); return new TypedObjectNode[] { new PrimitiveValue( formatter.format( value ) ) }; } catch ( IllegalArgumentException e ) { LOG.warn( "Evaluated value could not be parsed as a date (in an argument to FormatDate)." ); } return new TypedObjectNode[] { new PrimitiveValue( sb.toString().trim() ) }; }
private void exportSearchStatus202( XMLStreamWriter writer ) throws XMLStreamException { writer.writeStartElement( CSW_202_NS, "SearchStatus" ); writer.writeAttribute( "timestamp", ISO8601Converter.formatDateTime( new Date() ) ); // SearchStatus writer.writeEndElement(); }