 
   sprintf(buff, "%02d", minute);
   String minuteString = buff;
-  
+
   sprintf(buff, "%02d", second);
   String secondString = buff;
-  
+
   String result = hourString + ":" + minuteString + ":" + secondString + " ";
-  
+
   String dayOfWeek = getDayOfTheWeek(year, month, day);
-  
+
   sprintf(buff, "%02d", day);
   String dayString = buff;
 
   String monthString = getMonth(month);
-  
-  if(0 <= second && second <= 40){
+
+  if (0 <= second && second <= 40) {
     result += " " + dayOfWeek + " " + dayString;
   } else {
     result += monthString + year;

// From http://stackoverflow.com/a/21235587
String getDayOfTheWeek(int y, int m, int d) {
  String weekdayname[] = {"Sun", "Mon", "Tue",
  "Wed", "Thu", "Fri", "Sat"};

  int weekday = (d+=m<3?y--:y-2,23*m/9+d+4+y/4-y/100+y/400)%7;
  
  
  return weekdayname[weekday];
}

String getMonth(int month){
  switch(month){
    case 1: return "Jan";
    case 2: return "Feb";
    case 3: return "Mar";
    
    case 4: return "Apr";
    case 5: return "May";
    case 6: return "Jun";
    
    case 7: return "Jul";
    case 8: return "Aug";
    case 9: return "Sep";
    
    case 10: return "Oct";
    case 11: return "Nov";
    case 12: return "Dec";

#include <RTC_DS1307.h>

#include <LCD03.h>

#define BATT_PIN A3

#define LED_13_PIN 13

#define LDR_PIN A1

#define DHTPIN A0
#define DHTTYPE DHT22

#define LCD_CHAR_LENGTH 16

