 
 DateTime now = DateTime(0);
 
+/**
+ * converts a three letter english abbreviation for a month into the months number
+ */
 uint8_t parseMonth (char *mo) {
   if (!strcmp(mo, "Jan")) {
     return 1;

  }
  www.close();
  if (wehaveadate) {
    // please fucking refactor this shit
    // this is the fucking worst way to parse shit
    // TODO: refactor this into an union or something less fucking terrible
    line[10] = 0; // null after dow
    line[13] = 0; // null after dom
    line[17] = 0; // null after month
    line[22] = 0; // null after year
    line[25] = 0; // null after hour
    line[28] = 0; // null after minute
    line[31] = 0; // null after second
    char *s_year = line+18;
    char *s_month = line+14;
    char *s_day = line+11;
    char *s_hour = line+23;
    char *s_minute = line+26;
    char *s_second = line+29;
    return DateTime(atoi(s_year), parseMonth(s_month), atoi(s_day), atoi(s_hour), atoi(s_minute), atoi(s_second));    
  } else {
    return NULL;
  }

  }

  // try to read the Date line in the http headers
  dateline l;
  size_t pos = 0;
  bool wehaveadate = 0;
  unsigned long lastRead = millis();
  while (www.connected() && (millis() - lastRead < IDLE_TIMEOUT_MS)) {
    while (www.available()) {
      char c = www.read();
      if (c == '\n' || pos > LINELEN-2) { // we've reached a newline
        pos = 0;
        // now we need to see whether this is the 'Date:' line
        if (!strcmp(l.fields.date, "Date:")) { 
          wehaveadate = 1;
        }
      } else if (!wehaveadate) { // if we haven't reached a newline, put it in the buffer
        if (pos == 5 ||
            pos == 9 ||
            pos == 13||
            pos == 17||
            pos == 22||
            pos == 25||
            pos == 28||
            pos == 31) { // putting the nulls in the right place for field seperators
          l.line[pos] = 0;
        } else {
          l.line[pos] = c;
        }
        l.line[pos + 1] = 0;
        pos++;
      }
      lastRead = millis();
