Yes, that would help. Is there any way to compact the code so that it has fewer characters? Also, I am still getting the output for $mday to be 31. This means that it is interpreting if ($mday == 0) as true. However since today is the 2nd and the previous day was the 1st; this should be false.