Date in the Arduino

I was wondering if its possible to establish a date range in which the arduino should work, using a real time clock (rtc)? Thanks in advance!

Yes.

What exactly do you want to do?


Rob

I want to read the water flow from a water flow sensor. I want to do this process at a time range at a date range. What I need to do is repeat this process from let's say 7 AM to 9 AM and from 2 PM to 4 PM, from let's say from December to February and then from June to July. And after the process ends at that date (February) I want it to stop working and continue doing that same process until the next date (June). That's what I want to do, the thing is I don't know how to. Can someone please tell me how to do this? Thanks in advance!

Yes, you need to connect a real-time clock to your Arduino to do the timekeeping. See http://www.arduino.cc/playground/Main/InterfacingWithHardware#time for some libraries. The DS1307 seems to be the most popular choice, see e.g. this module http://www.sparkfun.com/products/99.

nando88:
What I need to do is repeat this process from let’s say 7 AM to 9 AM and from 2 PM to 4 PM, from let’s say from December to February and then from June to July.

//  Get Month and Hour from the RTC. 
const int FEBRUARY = 2; 
const int JUNE = 6;
const int JULY = 7;
const int DECEMBER = 12;
if (((month >= JUNE && month < JULY) || (month >= DECEMBER || month < FEBRUARY))
 && ((Hour >= 7 && Hour < 9) || (Hour >= 14 && Hour <16)))
   {
   // Put your code here
   }

Note: You said “June TO July” I assumed you did not mean to include July.