Arduino sleep with ds1302

Hi I am using arduino uno & RTC DS1302.

I am displaying the time & Date, using the following code. I want to use this timing values for sleeping functions. I want to switch on & off an LED with some delay(switch off in one time(19/12/2017, 03:30) & switch on in another time(19/12/2017, 4:30). How can I change the code?

Can any one explain?

#include <MyRealTimeClock.h>

MyRealTimeClock myRTC(6, 7, 8); // Assign Digital Pins 

void setup() {
Serial.begin(9600);


/* To set the current time and date in specific format 
| Second 00 | Minute 59 | Hour 10 | Day 12 |  Month 07 | Year 2015 |
*/

myRTC.setDS1302Time(00, 22, 03, 12 , 19, 12, 2017);
}

void loop() {

// Allow the update of variables for time / accessing the individual element. 
myRTC.updateTime();

Serial.print("Current Date / Time: "); 
Serial.print(myRTC.dayofmonth); // Element 1
Serial.print("/"); 
Serial.print(myRTC.month); // Element 2
Serial.print("/");
Serial.print(myRTC.year); // Element 3
Serial.print(" ");
Serial.print(myRTC.hours); // Element 4
Serial.print(":");
Serial.print(myRTC.minutes); // Element 5
Serial.print(":");
Serial.println(myRTC.seconds); // Element 6
delay( 5000);
}

MyRealTimeClock.zip (8.56 KB)

Maybe start like this:

if ( myRTC.hours == 3  && myRTC.minutes == 30 && myRTC.month == 12 ........... ) {
  // switch led on
}

want to use this timing values for sleeping functions. I want to switch on & off an LED with some delay(switch off in one time(19/12/2017, 03:30) & switch on in another time(19/12/2017, 4:30).

I don't understand what turning a LED on or off at a specific time has to do with sleeping.

How can I change the code?

Fire up the IDE, or your favorite text editor, and start hunting and pecking.

my arduino get time from RTC & depending on the time what I mentioned in the code(as a reference time), if it is OFF time the arduino will shut down, otherwise it is ON time the arduino will switch on.

If the Arduino is shut down, how do you expect it to get the time from the RTC to know when to start itself up?