Expected unqualified id before else

I honestly don’t know what is wrong with this. It doesn’t like the last big else statement
Here is the code.
Thanks

[

void loop() {

tmElements_t tm;

if (RTC.read™) {

Hour = tm.Hour;
Min = tm.Minute;
Sec = tm.Second;
Year = tmYearToCalendar(tm.Year);
Mon = tm.Month;
Day = tm.Day;

dst_x = (Year % 100);
dst_a = floor((dst_x - 20) / 4);
dst_b = floor((dst_x + dst_a) / 7);
dst_nov = (7 - (dst_x + dst_a - (7 * dst_b)));
dst_march = dst_nov + 7;

if (Mon == 11 && Day == dst_nov) {
dst_on = true;
}

if (Mon == 3 && Day == dst_march) {
dst_on = false;
}

if (dst_on == true){
Hour = Hour + 1;
}

if (Day != day_last) {
day_counter = day_counter++;
}

if (day_counter == 8) {
day_counter = 1;
}

lcd.setCursor(0 , 0);
lcd.print(Hour);
lcd.print(’:’);

if (Min >= 0 && Min < 10) {

lcd.print(‘0’);

}

lcd.print(Min);

lcd.print(’:’);

if (Sec >= 0 && Sec < 10) {

lcd.print(‘0’);

}

lcd.print(Sec);
lcd.setCursor(0 , 1);
lcd.print(Mon);
lcd.write(’/’);
lcd.print(Day);
lcd.write(’/’);
lcd.print(Year);
lcd.write(" ");
lcd.print(day_counter);

}

if (day_counter == 6 || day_counter == 7) {}

else {

if ((Hour == H1 && Min == M1 && Sec == S1) ||
(Hour == H2 && Min == M2 && Sec == S2) ||
(Hour == H3 && Min == M3 && Sec == S3) ||
(Hour == H4 && Min == M4 && Sec == S4))
{
SOLENOID_ON = true;
}

if ((Hour == H1 && Min == M1+2 && Sec == 0) ||
(Hour == H2 && Min == M2+2 && Sec == 0) ||
(Hour == H3 && Min == M3+2 && Sec == 0) ||
(Hour == H4 && Min == M4+2 && Sec == 0))
{
SOLENOID_ON = false;
}

if (SOLENOID_ON){
digitalWrite(sol, HIGH);
}
else{
digitalWrite(sol, LOW);

}
}

day_last = Day;
}

else {
if (RTC.chipPresent()) {
// Serial.println(“The DS1307 is stopped. Please run the SetTime”);
// Serial.println(“example to initialize the time and begin running.”);
// Serial.println();

} else {

// Serial.println(“DS1307 read error! Please check the circuitry.”);

// Serial.println();

}

delay(9000);
}
delay(1000);
}

]

Where does the function loop () end?

Please remember to use code tags when posting code.

the loop just ends at the bottom.

anlingyu:
the loop just ends at the bottom.

No.

Try again.

What are the square brackets for?

Use the IDE auto Format tool (ctrl-t or Tools, Auto Format) on your code. That may show that you have missmatched curly brackets.

You should post all the code. You should post in code tags. You should read the forum guidelines.