Page 1 of 1

using date

Posted: Sun Nov 30, 2003 6:59 pm
by mccommunity
I wrote this function and I want it to display like this 2003-11-30 but right now it is displaying like this 1072760400 how do I format this? This is my function:


function expire_date($months)
{
$date = mktime (0,0,0,date("m")+$months,date("d"), date("Y"));
return $date;
}



Thanks

Posted: Sun Nov 30, 2003 8:26 pm
by qads

Code: Select all

<?php
function expire_date($months) 
{ 
$date = mktime (0,0,0,date("m")+$months,date("d"), date("Y"));
return date("Y-m-d", $date);
}
?>
read more about [php_man]date[/php_man] at php.net.