Examples of toDateTimeString()


Examples of org.kuali.rice.core.api.datetime.DateTimeService.toDateTimeString()

        .thenReturn(dtFormat);
    ConfigContext.overrideConfig(Thread.currentThread()
        .getContextClassLoader(), config);
    DateTimeService dtSvc = mock(DateTimeService.class);
    SimpleDateFormat sdf = new SimpleDateFormat(dtFormat);
    when(dtSvc.toDateTimeString(date)).thenReturn(sdf.format(date));
    attributeValueReader.setDateTimeService(dtSvc);
    // create allowed formats
    List<String> allowedFormats = new ArrayList<String>();
    allowedFormats.add(dtFormat);
    allowedFormats.add("d MMM yyyy hh:mm a");
View Full Code Here

Examples of org.kuali.rice.core.api.datetime.DateTimeService.toDateTimeString()

   
    SimpleDateFormat sdf = new SimpleDateFormat(MartinlawConstants.DEFAULT_TIMESTAMP_FORMAT);
    final String formattedDate = sdf.format(event.getStartDate());
   
    DateTimeService dtSvc = mock(DateTimeService.class);
    when(dtSvc.toDateTimeString(same(event.getStartDate()))).thenReturn(formattedDate);
    event.setDateTimeService(dtSvc);
   
    return event;
  }
 
View Full Code Here

Examples of ucar.nc2.units.DateFormatter.toDateTimeString()

    } catch (ParseException e) {
      throw new RuntimeException("Cant read start_date="+start_date);
    }

    Variable v = ds.findVariable("time_offset");
    v.addAttribute(new Attribute( "units", "seconds since "+dfo.toDateTimeString(start)));

    Group root = ds.getRootGroup();
    root.addAttribute(new Attribute( "Convention", "Suomi-Station-CDM"));   
    ds.finish();
  }
View Full Code Here

Examples of ucar.nc2.units.DateFormatter.toDateTimeString()

        Variable timeVar = new Variable(ncfile, null, null, "time");
        timeVar.setDataType(DataType.INT);
        timeVar.setDimensions("time");
        timeVar.addAttribute(new Attribute("units",
                                           "seconds since "
                                           + df.toDateTimeString(nomTime)));
        timeVar.addAttribute(new Attribute("long_name", "time"));
        varArray = new ArrayInt.D1(1);
        ((ArrayInt.D1) varArray).set(0, 0);
        timeVar.setCachedData(varArray, false);
        ncfile.addVariable(null, timeVar);
View Full Code Here

Examples of ucar.nc2.units.DateFormatter.toDateTimeString()

        // add the attributes
        ncfile.addAttribute(null, new Attribute("Conventions", "CF-1.0"));
        ncfile.addAttribute(null, new Attribute("netCDF-Java", "4.0"));
        ncfile.addAttribute(null,
                            new Attribute("nominal_image_time",
                                          df.toDateTimeString(nomTime)));
        String encStr = "netCDF encoded on "
                        + df.toDateTimeString(new Date());
        ncfile.addAttribute(null, new Attribute("history", encStr));

        //Lastly, finish the file
View Full Code Here

Examples of ucar.nc2.units.DateFormatter.toDateTimeString()

        ncfile.addAttribute(null, new Attribute("netCDF-Java", "4.0"));
        ncfile.addAttribute(null,
                            new Attribute("nominal_image_time",
                                          df.toDateTimeString(nomTime)));
        String encStr = "netCDF encoded on "
                        + df.toDateTimeString(new Date());
        ncfile.addAttribute(null, new Attribute("history", encStr));

        //Lastly, finish the file
        ncfile.finish();
        return true;
View Full Code Here

Examples of ucar.nc2.units.DateFormatter.toDateTimeString()

  public List<NamedObject> getNames() {
    DateFormatter formatter = new DateFormatter();
    int n = (int) getSize();
    List<NamedObject> names = new ArrayList<NamedObject>(n);
    for (int i = 0; i < n; i++) {
      names.add(new NamedAnything(formatter.toDateTimeString(getTimeDate(i)), "date/time"));
    }
    return names;
  }

  /**
 
View Full Code Here

Examples of ucar.nc2.units.DateFormatter.toDateTimeString()

    Formatter sbuff = new Formatter();
    sbuff.format("%s %d %n", name, records.size());
    for (GridRecord record : records) {
      sbuff.format(" level = %d %f", record.getLevelType1(), record.getLevel1());
      if (null != record.getValidTime())
        sbuff.format(" time = %s", formatter.toDateTimeString(record.getValidTime()));
      sbuff.format("%n");
    }
    return sbuff.toString();
  }
View Full Code Here

Examples of ucar.nc2.units.DateFormatter.toDateTimeString()

        f.format("  %s%n", grid.getFullName());
      }

      f.format("%nRun Dates= %s%n", runtimes.size());
      for (Date date : runtimes) {
        f.format(" %s (", df.toDateTimeString(date));
        List<Inventory> list = runMap.get(date);
        if (list == null)
          f.format(" none");
        else {
          for (Inventory inv : list) {
View Full Code Here

Examples of ucar.nc2.units.DateFormatter.toDateTimeString()

        f.format(") %n");
      }

      f.format("%nForecast Dates= %d %n",forecasts.size());
      for (Date date : forecasts) {
        f.format(" %s(", df.toDateTimeString(date));
        List<Inventory> list = timeMap.get(date);
        if (list == null)
          f.format(" none");
        else {
          for (Inventory inv : list) {
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.