Some small corrections (as noted above by 'CrossRoads')
const unsigned long second = 1000UL;
const unsigned long minute = 60UL * second;
const unsigned long hour = 60UL * minute;
const unsigned long day = 24UL * hour;
const unsigned long alarmTime = 60041UL;
void setup()
{
Serial.begin(9600);
millis() == 0;
}
//todo: add a caseopened function to detect if the system has been loaded since it last went off. If it hasn't been loaded, set the alarm to not go off
void loop()
{
time();
}
void time()
{
unsigned long timeNow = millis();
int days = timeNow / day; // days since reset
int hours = (timeNow % day) / hour; // hours since start of day
int minutes = ((timeNow % day) % hour) / minute; // minutes since start of hour
int seconds = (((timeNow % day) % hour) % minute) / second; //seconds since start of minute
//turning the alarm on
// display current time
Serial.print(hours);
printDigits(minutes);
printDigits(seconds);
bool alarmisON = ((alarmTime == timeNow) ? true : false);
Serial.print(" boolean alarmisON = ");
Serial.println((alarmisON ? "true" : "false"));
}
void printDigits(byte digits)
{
Serial.print(":");
if ( digits < 10 )
{
Serial.print('0');
}
Serial.print(digits, DEC);
delay(1);
}