@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 ); }
case TIME: stmt.setDate( idx, new java.sql.Date( ( (Date) primVal.getValue() ).getTimeInMilliseconds() ) ); break; case DECIMAL:
private void writeSummaryElements( XMLStreamWriter writer ) throws XMLStreamException { for ( String s : getSubject() ) { write( writer, "subject", s, dc ); } for ( String f : getFormat() ) { write( writer, "format", f, dc ); } for ( String r : getRelation() ) { write( writer, "relation", r, dc ); } if ( getModified() != null ) { write( writer, "modified", getModified().getCalendar().getTime().toString(), dct ); } for ( String a : getAbstract() ) { write( writer, "abstract", a, dct ); } }
Timestamp modified = null; if ( rec.getModified() != null ) { modified = new Timestamp( rec.getModified().getTimeInMilliseconds() ); Timestamp revDate = null; if ( qp.getRevisionDate() != null ) { revDate = new Timestamp( qp.getRevisionDate().getTimeInMilliseconds() ); createDate = new Timestamp( qp.getCreationDate().getTimeInMilliseconds() ); pubDate = new Timestamp( qp.getPublicationDate().getTimeInMilliseconds() ); Timestamp begTmpExten = null; if ( qp.getTemporalExtentBegin() != null ) { begTmpExten = new Timestamp( qp.getTemporalExtentBegin().getTimeInMilliseconds() ); endTmpExten = new Timestamp( qp.getTemporalExtentEnd().getTimeInMilliseconds() ); Timestamp specDate = null; if ( qp.getSpecificationDate() != null ) { specDate = new Timestamp( qp.getSpecificationDate().getTimeInMilliseconds() );
protected PrimitiveValue toDateParticle( Object sqlValue ) { Temporal value = null; if ( sqlValue instanceof java.util.Date ) { Calendar cal = Calendar.getInstance(); cal.setTime( (java.util.Date) sqlValue ); value = new Date( cal, true ); } else if ( sqlValue != null ) { throw new IllegalArgumentException( "Unable to convert SQL result value of type '" + sqlValue.getClass() + "' to Date particle." ); } return new PrimitiveValue( value, pt ); }
@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 ); }
Calendar cal = new GregorianCalendar( year, month, day ); PrimitiveType pt = field.propertyType.getPrimitiveType(); PrimitiveValue pv = new PrimitiveValue( new Date( cal, true ), pt ); property = new SimpleProperty( field.propertyType, pv ); break; PrimitiveValue pv = new PrimitiveValue( new Date( cal, true ), pt ); property = new SimpleProperty( field.propertyType, pv ); break;