How to keep a 24 hour maximum and minimum temperature
You should also keep a timestamp of the last time you reset the min and max otherwise the arduino will keep thinking it's a new day:

//add to globals
unsigned long lastDay = 0;


and inside loop()

  if (timenow-lastday &gt;= day){

      maxtemp=0;
      mintemp=999;
      lastDay = timenow;
  }