Examples of RFC3339DateFormat


Examples of org.ulti.dev.powermeter.util.RFC3339DateFormat

    // https://www.google.com/powermeter/feeds/user/01266859867152863645/01266859867152863645/variable/currentcost.envi.MyEnvi.d1

    String subject = makeUserUrl() + "/variable/" + _variable;
    String url = BASE_URL + "event";

    RFC3339DateFormat idf = new RFC3339DateFormat();

    int counter = 0;
    for (PowerEvent event : events) {

      String eventString = "";

      Namespace meterNS = Namespace.getNamespace("meter", "http://schemas.google.com/meter/2008");
      Element meterElement = new Element("entry");
      meterElement.addNamespaceDeclaration(meterNS);

      Element categoryElement = new Element("category");
      categoryElement.setAttribute("scheme", "http://schemas.google.com/g/2005#kind");
      categoryElement.setAttribute("term", "http://schemas.google.com/meter/2008#durMeasurement");

      Element subjectElement = new Element("subject", meterNS);
      subjectElement.setText(subject);

      Element startElement = new Element("startTime", meterNS);
      startElement.setAttribute("uncertainty", "1.0");
      startElement.setText(idf.format(event.getStart()));

      Element endElement = new Element("endTime", meterNS);
      endElement.setAttribute("uncertainty", "1.0");
      endElement.setText(idf.format(event.getEnd()));

      Element quantityElement = new Element("quantity", meterNS);
      quantityElement.setAttribute("uncertainty", "0.001");
      quantityElement.setAttribute("unit", "kW h");
      quantityElement.setText(event.getQuantity() + "");
View Full Code Here

Examples of org.ulti.dev.powermeter.util.RFC3339DateFormat

      Element subjectElement = new Element("subject", meterNS);
      subjectElement.setText(subject);

      Element occurElement = new Element("occurTime", meterNS);
      occurElement.setAttribute("uncertainty", "1.0");
      occurElement.setText(new RFC3339DateFormat().format(event.getStart()));

      Element quantityElement = new Element("quantity", meterNS);
      quantityElement.setAttribute("uncertainty", "0.001");
      quantityElement.setAttribute("unit", "kW h");
      quantityElement.setText(event.getQuantity() + "");
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.