Timer for aquarium

Hello
I am new to this forum so if my post is not with in the rules please forgive me.
I am into aquarium hobby, recently i am trying planted aquarium but the problem happens that i sometime have to go out for 2/3 days from home or more so in that time i cannot turn on or off lights ( which is important to it ). i tried normal timer products but they tend not to work properly ( most works for max 7 days )

I bought 2 RTC modules ( ds1307 and ds1302 ) to make real time clock so i can turn the light on and off with relay modules . But as not having much idea on programming and just trying what ever i find online . i am pretty much stuck. i have seen few codes which seems would work for me.
first thing i am stuck is the RTC itself. both RTC are not showing me results on serial monitor . then i try to check the RTC it shows random times and jumps around on seconds. and some time it does not show at all.
here is my code

#include <Wire.h>
#include "RTClib.h"

int in1 = 2;
int in2 = 3;
int in3 = 4;
int in4 = 5;

RTC_DS1307 RTC;

void setup () {
Serial.begin(9600);
Wire.begin();
RTC.begin();
// Check to see if the RTC is keeping time. If it is, load the time from your computer.
if (! RTC.isrunning()) {
Serial.println("RTC is NOT running!");
// This will reflect the time that your sketch was compiled
RTC.adjust(DateTime(DATE, TIME));
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
pinMode(in3, OUTPUT);
pinMode(in4, OUTPUT);
delay(4000);
}
}
void loop () {
DateTime now = RTC.now();
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.day(), DEC);
Serial.print('/');

Serial.print(now.year(), DEC);
Serial.print(' ');
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();
if(now.hour()== 2 && now.minute() == 26 )
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
digitalWrite(in3, LOW);
digitalWrite(in4, LOW);
if(now.hour() == 18 )
digitalWrite(in1, HIGH);
digitalWrite(in2, HIGH);
digitalWrite(in3, HIGH);
digitalWrite(in4, HIGH);
delay(1000);
}

I don't have much understanding on how these codes works on audrino so if the whole thing is wrong please correct me.
thanks for your time