if ((($year % 4 == 0) && ($year % 100 != 0)) || ($year % 400) == 0) {$nod=$nod-366} else {$nod=$nod-365}; #check for the leap year.