josh97531:
i will use that code but change it so it will run more then 50 days because millis resets to zero after about 50 days
No, do NOT change it. As given, it correctly handles the rollover situation. (Whether your changed version would handle it correctly, I have no idea.)