Search in sources :

Example 6 with XmlDateTime

use of org.apache.xmlbeans.XmlDateTime in project arctic-sea by 52North.

the class SweCommonEncoderv101 method createDateTime.

private XmlDateTime createDateTime(DateTime sosDateTime) {
    XmlDateTime xbDateTime = XmlDateTime.Factory.newInstance(getXmlOptions());
    // encode the DateTime in UTC
    GDateBuilder gdb = new GDateBuilder(sosDateTime.toDate());
    gdb.normalize();
    xbDateTime.setGDateValue(gdb.toGDate());
    return xbDateTime;
}
Also used : XmlDateTime(org.apache.xmlbeans.XmlDateTime) GDateBuilder(org.apache.xmlbeans.GDateBuilder)

Aggregations

XmlDateTime (org.apache.xmlbeans.XmlDateTime)6 GDateBuilder (org.apache.xmlbeans.GDateBuilder)2 Instance (eu.esdihumboldt.hale.common.instance.model.Instance)1 InstanceCollection (eu.esdihumboldt.hale.common.instance.model.InstanceCollection)1 ResourceIterator (eu.esdihumboldt.hale.common.instance.model.ResourceIterator)1 Calendar (java.util.Calendar)1 Date (java.util.Date)1 Time (net.opengis.swe.x101.TimeDocument.Time)1 GDate (org.apache.xmlbeans.GDate)1 XmlAnySimpleType (org.apache.xmlbeans.XmlAnySimpleType)1 DateTime (org.joda.time.DateTime)1 SweTime (org.n52.shetland.ogc.swe.simpleType.SweTime)1 ConversionException (org.springframework.core.convert.ConversionException)1 ConversionService (org.springframework.core.convert.ConversionService)1