Try just using millis() directly instead of delay(). Something like (warning...untested code):
uint32_t lastTime;
void loop(void)
{
if ((millis() - lastTime) >= 1000) {
lastTime += 1000;
digitalClockDisplay();
}
......
}
This is actually a very smart way of doing it, because you avoid the problems with millisecond rollover.
I wonder why people seem to think that using the built-in millisecond counter inevitably results in problems at rollover.
Alternatively, I would suggest using the microsecond counter.
uint32_t lastTime = 0;
const int oneSecond = 1000000;
void loop(void)
{
if ((micros() - lastTime) >= oneSecond) {
lastTime += oneSecond;
digitalClockDisplay();
}
......
}
This rolls over every 1.2 hours or so, but that is not a problem in this sort of application. Another advantage -- in this application, quite a great one -- is that a clock that runs too fast or too slow is easily adjusted by changing the value of the constant oneSecond. (sort of like the fast/slow lever on a wind-up alarm clock)