user37251: For my application I need to simulate the sunlight including the rising and setting of the sun.
I have a program that will light up some LEDs slowly over a period of time but I need to know what to type in the (delay on) to keep the lights on for 7 hours? 
Will it work if I just replace delay(1000) with delay(25200000UL) ?
I don't want to run anything else at the same time and don't want to use or understand millis().
Thanks for any help.

user58008: It's an old one but I give an answer.
I think someone needs help like you.
I trying to make a fish meal machine with the Arduino Uno.
In the first.
I counted seconds over a minute.
It works well.
But when I try over an hour it does not work.
After all.
I got to know another way to count a long time
In the second.
I used the SimpleTimer.h.
The link is here.
Arduino SimpleTimer
It's an easy way to makes a circular moving but it has the same problem.
SimpleTime can't make a count over time.
I think it's 30 seconds.
Now I referenced StackExchange Arduino.
Here is my code.
#include <SimpleTimer.h>
#include <Servo.h>

#define FIVE_SEC 5000UL
#define ONE_MIN 60000UL
#define FIVE_MIN 300000UL
#define TEN_MIN 3000000UL
#define ONE_HR 3600000UL
#define EIGHT_HRS 28800000UL
#define TWELVE_HRS 43200000UL

SimpleTimer timer;
Servo servo;
int servoPin  = 9;
int servoReadyAngle = 180;
int servoMoveAngle = 170;
int servoMoveCnt = 0;
int servoJobCycle = 35000;

unsigned long startTime;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  servo.attach(servoPin);

  startTime = millis(); 
}

void loop() {

  if(millis()- startTime > TEN_MIN) {
    startTime = millis();
    giveAFishMeal();
  } else {
    Serial.print("ping ");
    Serial.println(millis());
  }

}

void giveAFishMeal() {

  int servoAngle;
  if(servoReadyAngle > servoMoveAngle) {
    servoAngle = servoReadyAngle - servoMoveAngle;
  } else {
    servoAngle = servoReadyAngle + servoMoveAngle;
  }

    Serial.println("I give a meal to your fish");

    delay(500);
    servo.write(servoReadyAngle);
    delay(500);
    servo.write(servoAngle);
    delay(500);

}


user19409: Yes you can write delay(25200000UL) and it will delay for 7 hours.
How it works
delay(x) will delay for x number of milliseconds.
1 second = 1000 milliseconds
1 minute = 60 seconds
1 hour = 60 minutes
7 hours = 1000 * 60 * 60 * 7 =  25,200,000
This number is quite large but is well within the scope of an unsigned long: 32 bits = (2^32)-1 = 4,294,967,295. Doing the sums, this will last for 49 days and 17 hours.
Delaying for >49 days
If for some reason you needed to go longer than 49 days, you can do so by placing the delay inside a for loop.
const unsigned long ONE_DAY = 24UL*3600*1000;
const unsigned int numOfDays = 51;
int i;
int j;

for( i=0; i<numOfDays; i++ )
{
    delay(ONE_DAY);
}


user7508: Yes, absolutely, it should work. But your code will be easier to read if
you use some constants, like:
const unsigned long SECOND = 1000;
const unsigned long HOUR = 3600*SECOND;

delay(7*HOUR);


37251: <p>For my application I need to simulate the sunlight including the rising and setting of the sun.</p>

<p>I have a program that will light up some LEDs slowly over a period of time but I need to know what to type in the (delay on) to keep the lights on for 7 hours? </p>

<p>Will it work if I just replace <code>delay(1000)</code> with <code>delay(25200000UL)</code> ?
I don't want to run anything else at the same time and don't want to use or understand <code>millis()</code>.
Thanks for any help.</p>
 58008: <p>It's an old one but I give an answer.
I think someone needs help like you.</p>

<p>I trying to make a fish meal machine with the Arduino Uno.</p>

<p>In the first.
I counted seconds over a minute.
It works well.
But when I try over an hour it does not work.</p>

<p>After all.
I got to know another way to count a long time</p>

<p>In the second.
I used the SimpleTimer.h.
The link is here.
<a href="https://playground.arduino.cc/Code/SimpleTimer/" rel="nofollow noreferrer">Arduino SimpleTimer</a></p>

<p>It's an easy way to makes a circular moving but it has the same problem.
SimpleTime can't make a count over time.
I think it's 30 seconds.</p>

<p>Now I referenced StackExchange Arduino.
Here is my code.</p>

<pre><code>#include &lt;SimpleTimer.h&gt;
#include &lt;Servo.h&gt;

#define FIVE_SEC 5000UL
#define ONE_MIN 60000UL
#define FIVE_MIN 300000UL
#define TEN_MIN 3000000UL
#define ONE_HR 3600000UL
#define EIGHT_HRS 28800000UL
#define TWELVE_HRS 43200000UL

SimpleTimer timer;
Servo servo;
int servoPin  = 9;
int servoReadyAngle = 180;
int servoMoveAngle = 170;
int servoMoveCnt = 0;
int servoJobCycle = 35000;

unsigned long startTime;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  servo.attach(servoPin);

  startTime = millis(); 
}

void loop() {

  if(millis()- startTime &gt; TEN_MIN) {
    startTime = millis();
    giveAFishMeal();
  } else {
    Serial.print("ping ");
    Serial.println(millis());
  }

}

void giveAFishMeal() {

  int servoAngle;
  if(servoReadyAngle &gt; servoMoveAngle) {
    servoAngle = servoReadyAngle - servoMoveAngle;
  } else {
    servoAngle = servoReadyAngle + servoMoveAngle;
  }

    Serial.println("I give a meal to your fish");

    delay(500);
    servo.write(servoReadyAngle);
    delay(500);
    servo.write(servoAngle);
    delay(500);

}
</code></pre>
 19409: <p>Yes you can write <code>delay(25200000UL)</code> and it will delay for 7 hours.</p>

<p><strong>How it works</strong><br>
<code>delay(x)</code> will delay for x number of milliseconds.<br>
1 second = 1000 milliseconds<br>
1 minute = 60 seconds<br>
1 hour = 60 minutes<br>
7 hours = 1000 * 60 * 60 * 7 =  25,200,000</p>

<p>This number is quite large but is well within the scope of an unsigned long: 32 bits = (2^32)-1 = 4,294,967,295. Doing the sums, this will last for 49 days and 17 hours.</p>

<p><strong>Delaying for >49 days</strong><br>
If for some reason you needed to go longer than 49 days, you can do so by placing the delay inside a <code>for</code> loop.</p>

<pre><code>const unsigned long ONE_DAY = 24UL*3600*1000;
const unsigned int numOfDays = 51;
int i;
int j;

for( i=0; i&lt;numOfDays; i++ )
{
    delay(ONE_DAY);
}
</code></pre>
 7508: <p>Yes, absolutely, it should work. But your code will be easier to read if
you use some constants, like:</p>

<pre><code>const unsigned long SECOND = 1000;
const unsigned long HOUR = 3600*SECOND;

delay(7*HOUR);
</code></pre>
