       year(t), month(t), day(t), hour(t), minute(t), second(t));
 }
 
+String returnISOdate() {
+  time_t t = now();
+  sprintf(isodate, "%4d-%02d-%02dT%02d:%02d:%02dZ",
+      year(t), month(t), day(t), hour(t), minute(t), second(t));
+  return (String(isodate));
+}
+
+String formatJSON(String tm, void *lum, float temp) {
+  Luminosity *lum2 = (Luminosity*)lum;
+  String JSON;
+  JSON = "{\"datetime\":\"" + tm + "\"," + 
+         "\"Temperature\":" + String(temp) + "," + 
+        "\"Luminosity\": {" + 
+            "\"IR\":" + String(lum2->IR) + "," +
+            "\"Full\":" + String(lum2->Full) + "," +
+            "\"Visible\":" + String(lum2->Visible) + "," +
+            "\"Lux\":" + String(lum2->Lux) + "}" + 
+        "}";
+    return (JSON);
+        
+}
+
+
 void loop()
 {
   uint8_t i;

    Serial.print("Lux: "); Serial.println(lum.Lux);
//


//    Serial.print(hour());
//    printDigits(minute());
//    printDigits(second());
//    Serial.print(' ');
//    Serial.print(day());
//    Serial.print(' ');
//    Serial.print(month());
//    Serial.print(' ');
//    Serial.print(year()); 
//    Serial.println();
makeISOdate();
    Serial.println(isodate);
    
    
//    int seconds = Wire.read(); // get seconds
//    int minutes = Wire.read(); // get minutes
//    int hours = Wire.read();   // get hours

#include <Wire.h>
#include <TSL2561.h> // this is the Lux sensor
#include <DS3232RTC.h>    //http://github.com/JChristensen/DS3232RTC


/**********************************
