troubles with set timer to read H:M:S:Am/Pm

i'm having a little issue with my sketch, this part is where i am having issue with and not sure how to fix it...

i have other "x int" in the array its not just 1 int... this is just a small part that is solo different from the reset of the function... and arduino forum wont let me post more then this due to over the limit... and its not relevent to this led dimming part so i just took what was need to be fix and not the whole sketch...

if (ledMoonLights1Dimmer==true) //if LED lights set on dimming on/off
        {
           for (x=13; x<14; x++)  //used for array for value of 13
              {   // Checks if the t.dow (time Day of week) is = to set day of week
                if ((t.dow==timerSetSux[x]) || (t.dow==timerSetMox[x]) || (t.dow==timerSetTux[x]) || (t.dow==timerSetWex[x]) || (t.dow==timerSetThx[x]) || (t.dow==timerSetFrx[x]) || (t.dow==timerSetSax[x]))
                      {  //checks if time is within timer on and timer off 
                        if ((timeHour>=timerOnH[x] && t.min>=timerOnM[x] && t.sec>=timerOnS[x]) && (timeHour<=timerOffH[x] && t.min<=timerOffM[x] && t.sec<=timerOffS[x]))
                          {
                            if (setTimeFormat==1)    //if RTC time set on 12hr then RTC uses "AM_PM" to display time as morning or noon,
         //timerAmPmOnx means RTC is set on 12hr base and checks if timer on is set to morning or noon time.
         //timerAmPmOffx  means RTC is set on 12hr base and checks if timer off is set to morning or noon time.
                                if (AM_PM==timerAmPmOnx[x])
                                  {
                                    if (x>12 && x<15){             // LED Moon Lights
                                      digitalWrite(ledMoonlightsPin, LOW);}  //LED Light Pin Low activate
                                  }
                               }
                            if (setTimeFormat==0)   //RTC set on a 24 hr base
                              {
                                if (x>12 && x<15){             // LED Moon Lights
                                  digitalWrite(ledMoonlightsPin, LOW);}    //LED Light Pin Low activate
                                }
                          }

my issue is here in red... where it checks if am pm if its the same for timer ampm set on...

i want it to check if timer on H:M:S:Am/Pm is within timer off H:M:S:Am/Pm...

the H:M:S i got down as you can see above but how do i combine it so that it can check if timer On H:M:S:Am/Pm is within the timer off H:M:S:Am/Pm set...

i hope that makes sense.... really need the help here guys

If x is an int, why the for loop? Why not do away with it and hard-code the index:

if (ledMoonLights1Dimmer==true) //if LED lights set on dimming on/off
{

        //   for (x=13; x<14; x++)  //used for array for value of 13
        //      {   // Checks if the t.dow (time Day of week) is = to set day of week

// ********** WE CAN ONLY GET HERE IF X = 13, SO WHY THE LOOP??********* 


  if ((t.dow==timerSetSux[13]) || (t.dow==timerSetMox[13]) || (t.dow==timerSetTux[13])  || 
       (t.dow==timerSetWex[13]) || (t.dow==timerSetThx[13]) || (t.dow==timerSetFrx[13]) ||
       (t.dow==timerSetSax[13]))
  {  //checks if time is within timer on and timer off 
     if ((timeHour>=timerOnH[13] && t.min>=timerOnM[13] && t.sec>=timerOnS13]) &&
         (timeHour<=timerOffH[13] && t.min<=timerOffM[13] && t.sec<=timerOffS[13]))
     {
       if (setTimeFormat==1)    //RTC set on a 12 hr base with am/pm
       {

// ********** WHATS THE PURPOSE OF THIS?? *****************************
          [COLOR="Red"] //if timer set on 12hr with am pm, checks if timer on is the same for am or pm...

// ********** WHY THE BITWISE OPERATOR?? ****************************** 
          (timerAmPmOnx = ampm for timer on) & (timerAmPmOffx = ampm for timer off)

// ********** WHAT IS THIS SUPPOSED TO DO???*************************** 

          if (AM_PM==timerAmPmOnx[13])[/COLOR]
          {

// ********** WE CAN ONLY GET HERE IF X = 13, SO WHY THE CHECK??********* 

             if (x>12 && x<15){             // LED Moon Lights
                digitalWrite(ledMoonlightsPin, LOW);}  //LED Light Pin Low activate
             }
           }
           if (setTimeFormat==0)   //RTC set on a 24 hr base
           {
// ********** WE CAN ONLY GET HERE IF X = 13, SO WHY THE CHECK??********* 

              if (x>12 && x<15){             // LED Moon Lights
                 digitalWrite(ledMoonlightsPin, LOW);
              }    //LED Light Pin Low activate
            }
          }

Does this code even compile? You need to attach all of the code.

           for (x=13; x<14; x++)  //used for array for value of 13

Why do you have a for loop to iterate just once? Get rid of it.

                                if (x>12 && x<15){             // LED Moon Lights

Is there a snowball's chance in hell that this won't be true?

                              {[COLOR="Red"] //if timer set on 12hr with am pm, checks if timer on is the same for am or pm... (timerAmPmOnx = ampm for timer on) & (timerAmPmOffx = ampm for timer off)

This nonsense won't even compile. You can NOT add color tags to code.

i have other in the array its not just 1 int... this is just a small part that is solo different from the reset of the function... and arduino forum wont let me post more then this over the limit...

sorry for the color tag it was suppost to displace that part in read so you guys see what i was talking about but i guess arduino doesnt allow it...

if (ledMoonLights1Dimmer==true) //if LED lights set on dimming on/off
{

        //   for (x=13; x<14; x++)  //used for array for value of 13
        //      {   // Checks if the t.dow (time Day of week) is = to set day of week

// ********** WE CAN ONLY GET HERE IF X = 13, SO WHY THE LOOP??********* 
// Answer: there is more then just x=13... but it does something else not relevant... //


  if ((t.dow==timerSetSux[13]) || (t.dow==timerSetMox[13]) || (t.dow==timerSetTux[13])  || 
       (t.dow==timerSetWex[13]) || (t.dow==timerSetThx[13]) || (t.dow==timerSetFrx[13]) ||
       (t.dow==timerSetSax[13]))
  {  //checks if time is within timer on and timer off 
     if ((timeHour>=timerOnH[13] && t.min>=timerOnM[13] && t.sec>=timerOnS13]) &&
         (timeHour<=timerOffH[13] && t.min<=timerOffM[13] && t.sec<=timerOffS[13]))
     {
       if (setTimeFormat==1)    //RTC set on a 12 hr base with am/pm
       {

// ********** WHATS THE PURPOSE OF THIS?? *****************************
// Answer: this just tells you what the bottom is doing... " if (AM_PM==timerAmPmOnx[13]) "

         //if RTC time set on 12hr then RTC uses "AM_PM" to display time as morning or noon,
         //timerAmPmOnx means RTC is set on 12hr base and checks if timer on is set to morning or noon time.
         //timerAmPmOffx  means RTC is set on 12hr base and checks if timer off is set to morning or noon time.

// ********** WHY THE BITWISE OPERATOR?? ****************************** 
//Answer: its not an operation, it was ment to describe what the "if (AM_PM==timerAmPmOnx[13])" means.
          (timerAmPmOnx = ampm for timer on) & (timerAmPmOffx = ampm for timer off)

// ********** WHAT IS THIS SUPPOSED TO DO???*************************** 
// Answer: discribe above... ^^^^^
          if (AM_PM==timerAmPmOnx[13])
          {

// ********** WE CAN ONLY GET HERE IF X = 13, SO WHY THE CHECK??********* 
// Answer: there is more then just x=13... but it does something else not relevant... //

             if (x>12 && x<15){             // LED Moon Lights
                digitalWrite(ledMoonlightsPin, LOW);}  //LED Light Pin Low activate
             }
           }
           if (setTimeFormat==0)   //RTC set on a 24 hr base
           {
// ********** WE CAN ONLY GET HERE IF X = 13, SO WHY THE CHECK??********* 
// Answer: there is more then just x=13... but it does something else not relevant... //

              if (x>12 && x<15){             // LED Moon Lights
                 digitalWrite(ledMoonlightsPin, LOW);
              }    //LED Light Pin Low activate
            }
          }

i hope i clear things up a little better now...