Examples of DateFormatter


Examples of ucar.nc2.units.DateFormatter

    String beginS = timeSpan.getChildText("begin");
    String endS = timeSpan.getChildText("end");
    String resS = timeSpan.getChildText("resolution");
    if ((beginS == null) || (endS == null)) return null;

    DateFormatter format = new DateFormatter();
    try {
      Date start = format.getISODate(beginS);
      Date end = format.getISODate(endS);
      DateRange dr = new DateRange(start, end);
     
      if (resS != null)
        dr.setResolution(new TimeDuration(resS));
View Full Code Here

Examples of ucar.nc2.units.DateFormatter

    // add date range
    Date start = gds.getStartDate();
    Date end = gds.getEndDate();
    if ((start != null) && (end != null)) {
      DateFormatter format = new DateFormatter();
      Element dateRange = new Element("TimeSpan");
      dateRange.addContent(new Element("begin").addContent(format.toDateTimeStringISO(start)));
      dateRange.addContent(new Element("end").addContent(format.toDateTimeStringISO(end)));
      rootElem.addContent(dateRange);
    }

    // add accept list
    Element elem = new Element("AcceptList");
View Full Code Here

Examples of ucar.nc2.units.DateFormatter

    // add date range
    Date start = gds.getStartDate();
    Date end = gds.getEndDate();
    if ((start != null) && (end != null)) {
      DateFormatter format = new DateFormatter();
      Element dateRange = new Element("TimeSpan");
      dateRange.addContent(new Element("begin").addContent(format.toDateTimeStringISO(start)));
      dateRange.addContent(new Element("end").addContent(format.toDateTimeStringISO(end)));
      rootElem.addContent(dateRange);
    }

    // add accept list
    Element elem = new Element("AcceptList");
View Full Code Here

Examples of ucar.nc2.units.DateFormatter

  private double getTime(StructureMembers.Member timeVar, StructureData sdata) {
    if (timeVar == null) return 0.0;

    if ((timeVar.getDataType() == DataType.CHAR) || (timeVar.getDataType() == DataType.STRING)) {
      String time = sdata.getScalarString(timeVar);
      if (null == formatter) formatter = new DateFormatter();
      Date date;
      try {
        date = formatter.isoDateTimeFormat(time);
      } catch (ParseException e) {
        log.error("Cant parse date - not ISO formatted, = "+time);
View Full Code Here

Examples of ucar.nc2.units.DateFormatter

      this.runDate = DateUnit.getStandardOrISO(runTime);
      if (this.runDate == null)
        throw new IllegalArgumentException(_Coordinate.ModelRunDate + " must be ISO date string " + runTime);
    } else {
      this.runDate = runDate;
      DateFormatter df = new DateFormatter();
      this.runTime = df.toDateTimeStringISO(runDate);
    }
    getIosp();

    // add each variable
    for (GridDatatype gg : gds.getGrids()) {
View Full Code Here

Examples of ucar.nc2.units.DateFormatter

    Element rootElem = doc.getRootElement();
    ForecastModelRunInventory fmr = new ForecastModelRunInventory();
    fmr.runTime = rootElem.getAttributeValue("runTime");

    DateFormatter formatter = new DateFormatter();
    fmr.runDate = formatter.getISODate(fmr.runTime);

    java.util.List<Element> eList = rootElem.getChildren("ensCoord");
    for (Element ensElem : eList) {
      EnsCoord ec = new EnsCoord();
      fmr.eaxes.add(ec);
View Full Code Here

Examples of ucar.nc2.units.DateFormatter

    // add date range
    Date start  = sobs.getStartDate();
    Date end  = sobs.getEndDate();
    if ((start != null) && (end != null)) {
      DateFormatter format = new DateFormatter();
      Element dateRange = new Element("TimeSpan");
      dateRange.addContent(new Element("begin").addContent(format.toDateTimeStringISO(start)));
      dateRange.addContent(new Element("end").addContent(format.toDateTimeStringISO(end)));
      rootElem.addContent( dateRange);
    }

    // add accept list
    Element elem = new Element("AcceptList");
View Full Code Here

Examples of ucar.nc2.units.DateFormatter

    assert time.getRank() == 1;
    assert time.getSize() == nagg;
    assert time.getShape()[0] == nagg;
    assert time.getDataType() == DataType.DOUBLE;

    DateFormatter formatter = new DateFormatter();
    try {
      Array data = time.read();
      assert data.getRank() == 1;
      assert data.getSize() == nagg;
      assert data.getShape()[0] == nagg;
View Full Code Here

Examples of ucar.nc2.units.DateFormatter

  {
    // temporalDomain
    Element temporalDomainElem = new Element( "temporalDomain", wcsNS );

    Date[] dates = timeAxis.getTimeDates();
    DateFormatter formatter = new DateFormatter();

    // temporalDomain/timePosition [1..*]
    for ( Date curDate : dates )
    {
      temporalDomainElem.addContent(
              new Element( "timePosition", gmlNS)
                      .addContent( formatter.toDateTimeStringISO( curDate )));
    }

      return temporalDomainElem;
  }
View Full Code Here

Examples of ucar.nc2.units.DateFormatter


  private List<InvDatasetImpl> makeRunDatasets() throws IOException {

    List<InvDatasetImpl> datasets = new ArrayList<InvDatasetImpl>();
    DateFormatter formatter = new DateFormatter();

    String id = getID();
    if (id == null)
      id = getPath();

    for (Date runDate : fmrc.getRunDates()) {
      String name = getName() + "_" + RUN_NAME + formatter.toDateTimeStringISO(runDate);
      name = StringUtil.replace(name, ' ', "_");
      InvDatasetImpl nested = new InvDatasetImpl(this, name);
      nested.setUrlPath(path + "/" + RUNS + "/" + name);
      nested.setID(id + "/" + RUNS + "/" + name);
      ThreddsMetadata tm = nested.getLocalMetadata();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.