TimeAlarms.h Cant seem to get alarms working!

For some reason I can not get any of the alarms working but the Alarm.timerRepeat(15, RepeatPhoto); // timer for every 15 seconds

here is the code

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

//Photoresistor
int lightPin = A0; //define a pin for Photo resistor
int ledPin = 11; //define a pin for LED
int PhotoValue; // This is a varibe to hold the PhotoSensor value

// Relay
int relayClosePin = 10; // This is drill forward "close door"
int relayOpenPin = 9; // This is drill backward "open door"
int relayLightsPin = 8; // All lights on
int relayNightPin = 7; // Night light on

// ------------------------------------------------------DateTime Function
RTC_DS1307 RTC;

int varYear, varMonth, varDay, varHour, varMin, varSec, varHour24;
char yearChar[5]; // set up the char varibles containers
char monthChar[5];
char dayChar[5];
char hourChar[5];
char minChar[5];
char secChar[5];
int varIsAmPm; // 1 is PM 0 is AM

// ------------------------------------------------------End DateTime Function

void setup() {
Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.
pinMode( ledPin, OUTPUT ); // Photoresistor
pinMode (relayClosePin, OUTPUT); // Relay1 as output pin
pinMode (relayOpenPin, OUTPUT); // Relay2 as output pin
pinMode (relayLightsPin, OUTPUT); // Relay3 as output pin
pinMode (relayNightPin, OUTPUT); // Relay4 as output pin

// ---------------------------- DateTime Function
Wire.begin();
RTC.begin();
if (! RTC.isrunning()) {
Serial.println("RTC is NOT running!");
// following line sets the RTC to the date & time this sketch was compiled
RTC.adjust(DateTime(DATE, TIME));
}

runDateTime(); // Show date and time once
// ---------------------------- End DateTime Function

// ---------------------------- Alarms Function

Alarm.alarmRepeat(5,30,0, NightOnAlarm); // 5:30am every day
Alarm.alarmRepeat(6,15,0, NightOffAlarm); // 6:15am every day
Alarm.alarmRepeat(6,0,0, AllLightsOnAlarm); // 6:00am every day
Alarm.alarmRepeat(9,0,0, AllLightsOffAlarm); // 9:00am every day Make sure that if you change these alarms that you change "Alarms" PhotoOnAlarm, PhotoOffAlarm times to match
Alarm.alarmRepeat(19,0,0, NightOn2Alarm); // 7:00pm every day Make sure that if you change these alarms that you change "Alarms" PhotoOnAlarm, PhotoOffAlarm times to match
Alarm.alarmRepeat(21,0,0, NightOff2Alarm); // 9:00pm every day
Alarm.alarmRepeat(16,47,0, DoorOpenAlarm); // 8:00am every day
Alarm.alarmRepeat(21,35,0, DoorCloseAlarm); // 9:30pm every day
Alarm.timerRepeat(15, RepeatPhoto); // timer for every 15 seconds
Alarm.alarmRepeat(17,41,0, EveningAlarm); // 5:45pm every day

}

void loop() {
runDateTimeUpDate ();
Alarm.delay(1000); // wait just one second between alarm checks
}

void AllLightsOnAlarm(){
runAllLights(1);
}

void AllLightsOffAlarm(){
runAllLights(0);
}

void NightOnAlarm(){
runNightLight(1);
}

void NightOffAlarm(){
runNightLight(0);
}

void NightOn2Alarm(){
runAllLights(1);
}

void NightOff2Alarm(){
runAllLights(0);
}

void DoorOpenAlarm(){
runOpenDoor (1);
}

void DoorCloseAlarm(){
runCloseDoor(1);
}

void PhotoOnAlarm(){
runPhoto ();
runDateTimeUpDate ();
if (PhotoValue < 500 && varHour24 < 19 && varHour24 > 9){ // change the times to match the varibles "Alarm.alarmRepeat"
runAllLights(1); // so that the alarm only turns the lights on during the day
}
}

void PhotoOffAlarm(){
runPhoto ();
runDateTimeUpDate ();
if (PhotoValue > 500 && varHour24 < 19 && varHour24 > 9){ // This is less then 7pm -and- greater than 9am
runAllLights(0); // PhotoValue > 400 if there is light outside greater then 500?
}
}

void RepeatPhoto(){
PhotoOnAlarm();
PhotoOffAlarm();
// DoorOpenAlarm ();
}

void Repeats(){
Serial.println("15 second timer");
}

void EveningAlarm(){
Serial.println("Alarm: - turn lights on");
}

void runPhoto(){
PhotoValue = analogRead(lightPin); //Write the value of the photoresistor to the varible PhotoValue
Serial.println(analogRead(lightPin)); //Write the value of the photoresistor to the serial monitor.
analogWrite(ledPin, analogRead(lightPin)/2); //send the value to the ledPin. Depending on value of resistor
//you have to divide the value. for example,
//with a 10k resistor divide the value by 2, for 100k resistor divide by 4.
delay(10); //short delay for faster response to light.
}

void runDateTime (){
DateTime now = RTC.now();

Serial.print(now.year(), DEC);
varYear = (now.year());
Serial.print('/');
Serial.print(now.month(), DEC);
varMonth = (now.month());
Serial.print('/');
Serial.print(now.day(), DEC);
varDay = (now.day());
Serial.print(' ');
Serial.print(now.hour(), DEC);
varHour = (now.hour());
varHour24 = (now.hour());
if (varHour >= 12){
varIsAmPm = 1; //this is Pm
}
else{
varIsAmPm = 0; // This is Am
}
if (varHour >= 13){
varHour = (varHour-12);
}
if (varHour < 1){
varHour = 12;
}
Serial.print(':');
Serial.print(now.minute(), DEC);
varMin = (now.minute());
Serial.print(':');
Serial.print(now.second(), DEC);
varSec = (now.second());
Serial.println();

Serial.print(" since midnight 1/1/1970 = ");
Serial.print(now.unixtime());
Serial.print("s = ");
Serial.print(now.unixtime() / 86400L);
Serial.println("d");

// calculate a date which is 7 days and 30 seconds into the future
DateTime future (now.unixtime() + 7 * 86400L + 30);

Serial.print(" now + 7d + 30s: ");
Serial.print(future.year(), DEC);
Serial.print('/');
Serial.print(future.month(), DEC);
Serial.print('/');
Serial.print(future.day(), DEC);
Serial.print(' ');
Serial.print(future.hour(), DEC);
Serial.print(':');
Serial.print(future.minute(), DEC);
Serial.print(':');
Serial.print(future.second(), DEC);
Serial.println();

Serial.println();

// -------------------------------Put Date and Time in Globle varibles and convert to chars
itoa (varYear, yearChar, 10);
itoa (varMonth, monthChar, 10);
itoa (varDay, dayChar, 10);
itoa (varHour, hourChar, 10);
itoa (varMin, minChar, 10);
itoa (varSec, secChar, 10);

}

void runDateTimeUpDate (){
DateTime now = RTC.now();
varYear = (now.year());
varMonth = (now.month());
varDay = (now.day());
varHour = (now.hour());
varHour24 = (now.hour());

Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();

if (varHour >= 12){
varIsAmPm = 1; //this is Pm
}
else{
varIsAmPm = 0; // This is Am
}
if (varHour >= 13){
varHour = (varHour-12);
}
if (varHour < 1){
varHour = 12;
}
varMin = (now.minute());
varSec = (now.second());
// -------------------------------Put Date and Time in Globle varibles and convert to chars
itoa (varYear, yearChar, 10);
itoa (varMonth, monthChar, 10);
itoa (varDay, dayChar, 10);
itoa (varHour, hourChar, 10);
itoa (varMin, minChar, 10);
itoa (varSec, secChar, 10);
}

void runCloseDoor (int onOff){
if (onOff == 1){
digitalWrite(relayClosePin, HIGH);
Serial.println("Closing Chicken Door");
}
else{
digitalWrite(relayClosePin, LOW);
Serial.println("Door Close Off");
}
}

void runOpenDoor (int onOff){
if (onOff == 1){
digitalWrite(relayOpenPin, HIGH);
Serial.println("Opening Chicken Door");
delay (3000);
}
else{
digitalWrite(relayClosePin, LOW);
Serial.println("Door Open Off");
}
}

void runAllLights (int onOff){
if (onOff == 1){
digitalWrite(relayLightsPin, HIGH);
Serial.println("All Coop Lights Are On");
}
else{
digitalWrite(relayLightsPin, LOW);
Serial.println("All Coop Lights Are Off");
}
}

void runNightLight (int onOff){
if (onOff == 1){
digitalWrite(relayNightPin, LOW);
Serial.println("Coop Night Lihgt Is On");
}
else{
digitalWrite(relayNightPin, LOW);
Serial.println("Coop Night Light Is Off");
}
}

Thanks for your help

Alarm.alarmRepeat(5,30,0, NightOnAlarm);       // 5:30am every day
  Alarm.alarmRepeat(6,15,0, NightOffAlarm);      // 6:15am every day
  Alarm.alarmRepeat(6,0,0, AllLightsOnAlarm);    // 6:00am every day
  Alarm.alarmRepeat(9,0,0, AllLightsOffAlarm);   // 9:00am every day Make sure that if you change these alarms that you change "Alarms" PhotoOnAlarm, PhotoOffAlarm times to match
  Alarm.alarmRepeat(19,0,0, NightOn2Alarm);      // 7:00pm every day Make sure that if you change these alarms that you change "Alarms" PhotoOnAlarm, PhotoOffAlarm times to match
  Alarm.alarmRepeat(21,0,0, NightOff2Alarm);     // 9:00pm every day
  Alarm.alarmRepeat(16,47,0, DoorOpenAlarm);     // 8:00am every day
  Alarm.alarmRepeat(21,35,0, DoorCloseAlarm);    // 9:30pm every day
  Alarm.timerRepeat(15, RepeatPhoto);            // timer for every 15 seconds
  Alarm.alarmRepeat(17,41,0, EveningAlarm);       // 5:45pm every day

and

#define dtNBR_ALARMS 6   // max is 255

don't seem to be compatible.

Yes I have changed "#define dtNBR_ALARMS 6" to 12 but it still does not work

Perhaps the key is to NOT have a bazillion lines of code. Write a simple sketch to trigger an alarm every 10 seconds. Does that work?

even this does not work and most of it is the example sketch

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

RTC_DS1307 RTC;

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

if (! RTC.isrunning()) {
Serial.println("RTC is NOT running!");
// following line sets the RTC to the date & time this sketch was compiled
RTC.adjust(DateTime(DATE, TIME));
}

Alarm.alarmRepeat(8,30,0, MorningAlarm); // 8:30am every day
Alarm.alarmRepeat(20,36,0,EveningAlarm); // 5:45pm every day
Alarm.alarmRepeat(dowSaturday,8,30,30,WeeklyAlarm); // 8:30:30 every Saturday

Alarm.timerRepeat(15, Repeats); // timer for every 15 seconds
Alarm.timerOnce(10, OnceOnly); // called once after 10 seconds
}

void loop(){
DateTime now = RTC.now();
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();
Alarm.delay(1000); // wait one second between clock display
}

// functions to be called when an alarm triggers:
void MorningAlarm(){
Serial.println("Alarm: - turn lights off");
}

void EveningAlarm(){
Serial.println("Alarm: - turn lights on");
}

void WeeklyAlarm(){
Serial.println("Alarm: - its Monday Morning");
}

void ExplicitAlarm(){
Serial.println("Alarm: - this triggers only at the given date and time");
}

void Repeats(){
Serial.println("15 second timer");
}

void OnceOnly(){
Serial.println("This timer only triggers once");
}

any idea?

That code does something. You have not described what it does.

You expect it to do something. You have not described what you expect.

You have not posted your code correctly, once.

any idea?

Well, maybe.

Sorry for the confusion. The new code that I posted is shorter but does the same thing as far as the alarms go.
I am trying to get these alarms working
Alarm.alarmRepeat(8,30,0, MorningAlarm); // 8:30am every day
Alarm.alarmRepeat(20,36,0,EveningAlarm); // 5:45pm every day
Alarm.alarmRepeat(dowSaturday,8,30,30,WeeklyAlarm); // 8:30:30 every Saturday
Alarm.timerRepeat(15, Repeats); // timer for every 15 seconds
Alarm.timerOnce(10, OnceOnly); // called once after 10 seconds

The only one that works is
Alarm.timerRepeat(15, Repeats); // timer for every 15 seconds
Alarm.timerOnce(10, OnceOnly); // called once after 10 seconds

but the TimeAlarms.h fails to run the other alarms
Alarm.alarmRepeat(8,30,0, MorningAlarm); // 8:30am every day
Alarm.alarmRepeat(20,36,0,EveningAlarm); // every day
Alarm.alarmRepeat(dowSaturday,8,30,30,WeeklyAlarm); // 8:30:30 every Saturday

Nor correctly thrice, posted the code as described in the 'Sticky' at the top of the forum, just below the New Topic button

Ok I will post it better next time.

I could not get Time.h, TimeAlarms.h to play nice with RTClib.h
Time.h set the time as one thing in 12 hour and then RTClib.h another time in 24hour
both would work fine without the other for all timers
and both would work together as long as I only used the "Alarm.timerOnce" or the "Alarm.timerRepeat" and not the "Alarm.alarmRepeat"

Sp I oped to not use "Alarm.alarmRepeat" just coded it myself which was a lot easier!

Thanks for your help

Here is the code if anyone is interested

void checkAlarms(){
  runDateTimeUpDate();
  if (varHour24 == 5 && varMin == 15){    // If it is 5:15am turn night light on
   NightOnAlarm(); 
  }
  if (varHour24 == 6 && varMin == 15){     // Now turn it off if 6:15am
   NightOffAlarm(); 
  } 
  if (varHour24 == 6 && varMin == 15){    // If it is 6:15am then turn All lights on
   AllLightsOnAlarm ();
  }    
  if (varHour24 == 9 && varMin == 15){    // Now turn then off 9:15am
    AllLightsOffAlarm();
  }
  if (varHour24 == 19 && varMin == 15){   // Turn on 7:15
   NightOn2Alarm(); 
  }
  if (varHour24 == 21 && varMin == 15){   // Turn on 9:15pm
   NightOff2Alarm(); 
  }
  if (varHour24 == 8 && varMin == 15){   // Turn on 9:15am Open door
   DoorOpenAlarm(); 
  }
  if (varHour24 == 21 && varMin == 30){   // Turn on 9:30pm Close door
   DoorCloseAlarm(); 
  }
  if (varHour24 == 23 && varMin == 48){    //Sample Test
    Repeats();
  }
}

Here a sketch which you can test, please try to use the times alarm library.
You can add the other stuff you had after have proving things work with this.

#include <Time.h>
#include <TimeAlarms.h>
#include <Wire.h>             

//=========================================================================
void setup()
{
  Serial.begin(9600);
  Wire.begin();

  //                                ****** Lines used to test the 3 alarms, uncomment as needed ******
  //  setTime(8,29,50,2,9,13);  //Hour,Minute,Second,Day,Month,Year      Morning
  //  setTime(20,44,50,2,9,13); //Hour,Minute,Second,Day,Month,Year     Evening
       setTime(7,59,50,7,9,13);      //Hour,Minute,Second,Day,Month,Year  Saurday


  Alarm.alarmRepeat(8,30,0, MorningAlarm);                   // 8:30am every day
  Alarm.alarmRepeat(20,45,0,EveningAlarm);                  // 5:45pm every day 
  Alarm.alarmRepeat(dowSaturday,8,0,0,WeeklyAlarm);  // 8:00:00 every Saturday 

} 
//                             END of setup()

//==========================================================================

void  loop()
{  
  Serial.print(hourFormat12());
  printDigits(minute());
  printDigits(second());
  Serial.println("");
  Serial.println(dayStr(weekday()));
  Serial.print(monthStr(month()));  
  Serial.print("  ");
  Serial.print(day());
  Serial.print("  ");
  Serial.println(year());  
  Alarm.delay(1000);

}
//                                END of loop()

//**************************************************************************
//**************************************************************************
//Function for digital clock display: prints preceding colon and leading 0
//
void printDigits(int digits)
{
  Serial.print(":");
  if(digits < 10)
  {
    Serial.print('0');
  }  
  Serial.print(digits);
}
//**************************************************************************

// functions to be called when an alarm triggers:
void MorningAlarm()
{
  Serial.println("Alarm: - turn lights off");    
}

void EveningAlarm()
{
  Serial.println("Alarm: - turn lights on");           
}

void WeeklyAlarm()
{
  Serial.println("Alarm: - its Saturday Morning");      
}

Your code works fine but as soon as I try to set the time at sketch compile using the RTC the alarms stop working I think that the TimeAlarms.h is wanting the time format that is different then the RTC? Heres the code

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

RTC_DS1307 RTC;
//=========================================================================
void setup()
{
  Serial.begin(9600);
  Wire.begin();
    RTC.begin();
    if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));
    }

  //                                ****** Lines used to test the 3 alarms, uncomment as needed ******
  //  setTime(8,29,50,2,9,13);  //Hour,Minute,Second,Day,Month,Year      Morning
  //  setTime(20,44,50,2,9,13); //Hour,Minute,Second,Day,Month,Year     Evening
   //    setTime(7,59,50,7,9,13);      //Hour,Minute,Second,Day,Month,Year  Saurday


  Alarm.alarmRepeat(9,4,0, MorningAlarm);                   // 8:30am every day
  Alarm.alarmRepeat(20,45,0,EveningAlarm);                  // 5:45pm every day 
  Alarm.alarmRepeat(dowSaturday,8,0,0,WeeklyAlarm);  // 8:00:00 every Saturday 

} 
//                             END of setup()

//==========================================================================

void  loop()
{  
  DateTime now = RTC.now();
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();
  Alarm.delay(1000);
  
  /*
  Serial.print(hourFormat12());
  printDigits(minute());
  printDigits(second());
  Serial.println("");
  Serial.println(dayStr(weekday()));
  Serial.print(monthStr(month()));  
  Serial.print("  ");
  Serial.print(day());
  Serial.print("  ");
  Serial.println(year());  
  Alarm.delay(1000);
  */
}
//                                END of loop()

//**************************************************************************
//**************************************************************************
//Function for digital clock display: prints preceding colon and leading 0
//
void printDigits(int digits)
{
  Serial.print(":");
  if(digits < 10)
  {
    Serial.print('0');
  }  
  Serial.print(digits);
}
//**************************************************************************

// functions to be called when an alarm triggers:
void MorningAlarm()
{
  Serial.println("Alarm: - turn lights off");    
}

void EveningAlarm()
{
  Serial.println("Alarm: - turn lights on");           
}

void WeeklyAlarm()
{
  Serial.println("Alarm: - its Saturday Morning");      
}

Do you think this will set the time of the RTC?

    if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));

Notice it says...

   if (! RTC.isrunning()) {

So, it ONLY sets RTC to time compiled IF it's not already running which, if you've been trying this over & over, is probably NOT the case.

To force it to set the RTC, try commenting out a few lines like this -

  Wire.begin();
    RTC.begin();
    //  if (! RTC.isrunning()) {
    //  Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));
    // }

Just REMEMBER to change it back once after you get your RTC set, or it will reset it (to that same time) every time you restart Arduino.
Do you have backup battery attached to RTC module?

Your code works fine but as soon as I try to set the time at sketch compile using the RTC the alarms stop working I think that the TimeAlarms.h is wanting the time format that is different then the RTC? Heres the code

Why do you think that? How do you know what it wants?
Are you getting an error? What does it say?

Also, RTCLib usually doesn't "like" to be included after the time library. If getting an error at compile...this may be why.

I typically have to order things more like this -

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

And....I don't see any code that uses the RTC to set the time on Arduino.

Try adding this after
"DateTime now = RTC.now();"

       setTime(now.hour(), now.minute(), now.second(), now.day(), now.minute(), now.year());      //Hour,Minute,Second,Day,Month,Year  Saurday

I did what you suggested with no luck! here is the code again

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


RTC_DS1307 RTC;
//=========================================================================
void setup()
{
  Serial.begin(9600);
  Wire.begin();
    RTC.begin();
    if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));
    }

  //                                ****** Lines used to test the 3 alarms, uncomment as needed ******
  //  setTime(8,29,50,2,9,13);  //Hour,Minute,Second,Day,Month,Year      Morning
  //  setTime(20,44,50,2,9,13); //Hour,Minute,Second,Day,Month,Year     Evening
  //    setTime(7,59,50,7,9,13);      //Hour,Minute,Second,Day,Month,Year  Saurday


  Alarm.alarmRepeat(11,55,0, MorningAlarm);                   // 8:30am every day
  Alarm.alarmRepeat(20,45,0,EveningAlarm);                  // 5:45pm every day 
  Alarm.alarmRepeat(dowSaturday,8,0,0,WeeklyAlarm);  // 8:00:00 every Saturday 

} 
//                             END of setup()

//==========================================================================

void  loop()
{  
  DateTime now = RTC.now();
  setTime(now.hour(), now.minute(), now.second(), now.day(), now.minute(), now.year());      //Hour,Minute,Second,Day,Month,Year  
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();
  Alarm.delay(1000);
  
}
//                                END of loop()

// functions to be called when an alarm triggers:
void MorningAlarm()
{
  Serial.println("Alarm: - turn lights off");    
}

void EveningAlarm()
{
  Serial.println("Alarm: - turn lights on");           
}

void WeeklyAlarm()
{
  Serial.println("Alarm: - its Saturday Morning");      
}

It still does not run the alarm triggers

  Alarm.alarmRepeat(11,55,0, MorningAlarm);                   // 8:30am every day
  Alarm.alarmRepeat(20,45,0,EveningAlarm);                    // 5:45pm every day 
  Alarm.alarmRepeat(dowSaturday,8,0,0,WeeklyAlarm);      // 8:00:00 every Saturday

I did try commenting out

  Wire.begin();
    RTC.begin();
    //  if (! RTC.isrunning()) {
    //  Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));
    // }

But that did not help with the alarms not running
I also added the line but that did not help

setTime(now.hour(), now.minute(), now.second(), now.day(), now.minute(), now.year());      //Hour,Minute,Second,Day,Month,Year

I have no idea why its not calling the alarms!
Thanks for your help

Used the system clock then once per day (example: midnight) update system clock to the RTC.

#include <Time.h>  
#include <DS1307RTC.h>        //RTC DS1307 library that returns time as a time_t
#include <Wire.h>                 //Needed for IIC (I2C) comunications
#include <TimeAlarms.h>      //Changed Number of  alarms dtNBR_ALARMS to 30 

//
//**************************************************************************
//Define Section
//
//#define TIME_MSG_LEN  11 //Time sync to PC is HEADER followed by unix time_t as ten ascii digits
//#define TIME_HEADER  'T'   //Header tag for serial time sync message
//#define TIME_REQUEST  7  //ASCII bell character requests a time sync message 

#define DS1307_ID 0x68    //Address of the RTC

//
//**************************************************************************
//Global Variable Section
//

//time_t t               = now();  //Used for RTC time correction at midnight  

//
//##########################################################################
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% S E T U P ( ) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//##########################################################################
//
void setup()
{
  //***** Initialization *****
  Serial.begin(9600);

  //Check to see if the RTC is present.  Set the clock accordingly
  Wire.beginTransmission(DS1307_ID);
  Wire.write((uint8_t)0x00);
  //**********************
  if (Wire.endTransmission() == 0) //Did the RTC respond?
  {
    setSyncProvider(RTC.get);        //Yes it did, get the time from the RTC  
  }
  else                                            //No it didn't, set the clock from this code
  {
    setTime(9,14,50,8,9,13);          //Hour,Minute,Second,Day,Month,Year
    //setTime(12,19,55,7,12,13);   //Hour,Minute,Second,Day,Month,Year
    //setTime(1354532395);          //Can also use EPOCH Time to set the clock
  }

  //
  //**************************************************************************    
  //Define all Periodic Alarms
  //                      ! ! ! ! I M P O R T A N T ! ! ! ! 
  //Changed Number of  alarms dtNBR_ALARMS in TimeAlarms.h for # of alarms: NOW AT 30
  //# of alarms * 11 = RAM bytes necessary  30*11=330 RAM Locations. Maximum is 255 Alamrs


  //Daily Alarms                                    Alarm ## 
  Alarm.alarmRepeat(7,30,0, Alarm730);                //
  Alarm.alarmRepeat(15,00,0, Alarm1500);              // 

  Alarm.alarmRepeat(dowSunday,9,15,0, AlarmChurch);   // 

}
//                              END of Setup()


//
//##########################################################################
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% L O O P ( ) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//##########################################################################
//
void loop()
{    
  //**********************         Update the Arduino clock to the RTC at midnight
  if(hour()==0 && minute()==0 && second()==0) //If it is 00:00:00 update the Clock
  {
    setSyncProvider(RTC.get);                            //It's time, sync the Clock to the RTC
  }
  //**********************

  digitalClockDisplay();      //Update the Clock Display

    Alarm.delay(1000);       // Wait 1000mS then start the LOOP again

}                                      // End of Loop()

//
//##########################################################################
//%%%%%%%%%%%%%%%%%%%%%%%%%% F U N C T I O N S %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//##########################################################################

//
//***********************************************
//Function to Display Time and Date
void   digitalClockDisplay(void)
{
  Serial.print(hourFormat12());
  printDigits(minute());
  printDigits(second());
  Serial.println("");
  Serial.println(dayStr(weekday()));
  Serial.print(monthStr(month()));  
  Serial.print("  ");
  Serial.print(day());
  Serial.print("  ");
  Serial.println(year());  
}

//
//***********************************************
//Function for digital clock display: prints preceding colon and leading 0
//
void printDigits(int digits)
{
  Serial.print(":");
  if(digits < 10)
  {
    Serial.print('0');
  }  
  Serial.print(digits);
}

//Functions called when an alarm triggers:
//***********************************************

//Breakfast
void Alarm730()
{
  Serial.println("Alarm: - turn lights off");    
}

//***********************************************
//Coffee
void Alarm1500()
{
  Serial.println("Alarm: - turn lights on");          
}

//***********************************************
//Get Ready for Church
void AlarmChurch()
{
  Serial.println("Ready for Church?");  
}

//                   END of Sketch

LarryD This does work but why does it work? and not the others?

My guess is you need:
setSyncProvider(RTC.get); // Get the time from the RTC

My code is a stripped down version of a sketch I use; some lines may not be needed in your application.

Note:
You really only need to read the RTC at power up and lets say 12 midnight.

Do you have this posted over on Adafruit forums, too?

I posted something over there about how

   if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));

will NOT set the time on the RTC how you think it will (...and how I THOUGHT it did). I recently wasted about two days trying to get this same code to work.

Take a closer look at this part

    if (! RTC.isrunning())

It only sets the RTC time if the RTC is not already running....which it probably is since you've been playing with this for a while now.

And....I didn't see any code which used the RTC time to set the Arduino's time so that other libraries (alarms) would 'know' what it is. (As LarryD just mentioned.)

Ok I think that I understand what is going on! I would like to thank all of you for your help and time!
If it was not for you and your understanding, I would have never understood what was happening!

Thanks....

Ok I thinks I understand what is going on!

There is two clocks one is the RTC, and second is the Arduino

So I have to set the Arduino's clock to the RTC in the setup

   void setup()
{
  Serial.begin(9600);
  Wire.begin();
    RTC.begin();
    if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));
    }
    
    DateTime now = RTC.now();
    setTime(now.hour(), now.minute(), now.second(), now.day(), now.minute(), now.year());      //Hour,Minute,Second,Day,Month,Year

And now it works

Thank all of you for your help! If it was not for your time I would have never understood what was going on!
Thanks