In message <24247.72381.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>, agus susilo <deffleo@xxxxxxxxx> writes >hi expert!. > >i need help to calculate a date, how much the remain of day?, >i try subtract(-) between $expire_date and date now. so, i subtract a year >first, >and then month, at last a day. There is an example in the manual, http://es.php.net/manual/en/function.mktime.php function daysBetween($date1, $date2) Assuming that one of your dates is always now, you could shorten this function. And I assume that the 6 lines in the function similar to $year1 = $d1[0]; are only there to simplify viewing the code, as they aren't necessary. -- Pete Clark Sunny Andalucia http://hotcosta.com/Andalucia.Spain