cdm/src/main/java/thredds/client/catalog/builder/CatalogBuilder.java
protected DateRange readTimeCoverage(Element tElem) {
    if (tElem == null) {
      return null;
    }
    
    Calendar calendar = readCalendar(tElem.getAttributeValue("calendar"));
    DateType start = readDate(tElem.getChild("start", Catalog.defNS), calendar);
    DateType end = readDate(tElem.getChild("end", Catalog.defNS), calendar);

    TimeDuration duration = readDuration(tElem.getChild("duration", Catalog.defNS));
    TimeDuration resolution = readDuration(tElem.getChild("resolution", Catalog.defNS));

    try {
      return new DateRange(start, end, duration, resolution);
    }
    catch (java.lang.IllegalArgumentException e) {
      errlog.format(" ** warning: TimeCoverage error ='%s'%n", e.getMessage());
      logger.debug(" ** warning: TimeCoverage error ='{}'", e.getMessage());
      return null;
    }
  }
protected DateRange readTimeCoverage(Element tElem) {
    if (tElem == null) {
      return null;
    }
    
    Calendar calendar = readCalendar(tElem.getAttributeValue("calendar"));
    DateType start = readDate(tElem.getChild("start", Catalog.defNS), calendar);
    DateType end = readDate(tElem.getChild("end", Catalog.defNS), calendar);

    TimeDuration duration = readDuration(tElem.getChild("duration", Catalog.defNS));
    TimeDuration resolution = readDuration(tElem.getChild("resolution", Catalog.defNS));

    try {
      return new DateRange(start, end, duration, resolution);
    }
    catch (java.lang.IllegalArgumentException e) {
      errlog.format(" ** warning: TimeCoverage error ='%s'%n", e.getMessage());
      logger.debug(" ** warning: TimeCoverage error ='{}'", e.getMessage());
      return null;
    }
  }
protected DateRange readTimeCoverage ( Element tElem ) { if ( tElem == null ) { return null ; } Calendar calendar = readCalendar ( tElem . getAttributeValue ( "calendar" ) ) ; DateType start = readDate ( tElem . getChild ( "start" , Catalog . defNS ) , calendar ) ; DateType end = readDate ( tElem . getChild ( "end" , Catalog . defNS ) , calendar ) ; TimeDuration duration = readDuration ( tElem . getChild ( "duration" , Catalog . defNS ) ) ; TimeDuration resolution = readDuration ( tElem . getChild ( "resolution" , Catalog . defNS ) ) ; try { return new DateRange ( start , end , duration , resolution ) ; } catch ( java . lang . IllegalArgumentException e ) { errlog . format ( " ** warning: TimeCoverage error ='%s'%n" , e . getMessage ( ) ) ; logger . debug ( " ** warning: TimeCoverage error ='{}'" , e . getMessage ( ) ) ; return null ; } }
/*
<xsd:complexType name="timeCoverageType">
<xsd:sequence>
<xsd:attribute name="calendar" type="xsd:string"/>
<xsd:choice minOccurs="2" maxOccurs="3">
<xsd:element name="start" type="dateTypeFormatted"/>
<xsd:element name="end" type="dateTypeFormatted"/>
<xsd:element name="duration" type="duration"/>
</xsd:choice>
<xsd:element name="resolution" type="duration" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>

<!-- may be a dateType or have a format attribute  -->
<xsd:complexType name="dateTypeFormatted">
<xsd:simpleContent>
<xsd:extension base="dateType">
<xsd:attribute name="format" type="xsd:string"/>
<!-- follow java.text.SimpleDateFormat -->
<xsd:attribute name="type" type="dateEnumTypes"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>

<!-- may be a built in date or dateTIme, or a udunit encoded string -->
<xsd:simpleType name="dateType">
<xsd:union memberTypes="xsd:date xsd:dateTime udunitDate">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:enumeration value="present"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:union>
</xsd:simpleType>

<xsd:simpleType name="udunitDate">
<xsd:restriction base="xsd:string">
<xsd:annotation>
<xsd:documentation>Must conform to complete udunits date string, eg "20 days since 1991-01-01"</xsd:documentation>
</xsd:annotation>
</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="duration">
<xsd:union memberTypes="xsd:duration udunitDuration"/>
</xsd:simpleType>

<xsd:simpleType name="udunitDuration">
<xsd:restriction base="xsd:string">
<xsd:annotation>
<xsd:documentation>Must conform to udunits time duration, eg "20.1 hours"</xsd:documentation>
</xsd:annotation>
</xsd:restriction>
</xsd:simpleType>
/ * <xsd : complexType name = timeCoverageType > <xsd : sequence > <xsd : attribute name = calendar type = xsd : string / > <xsd : choice minOccurs = 2 maxOccurs = 3 > <xsd : element name = start type = dateTypeFormatted / > <xsd : element name = end type = dateTypeFormatted / > <xsd : element name = duration type = duration / > < / xsd : choice > <xsd : element name = resolution type = duration minOccurs = 0 / > < / xsd : sequence > < / xsd : complexType >