PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
function fnc_date_calc($this_date,$num_days,$display){
$my_time = strtotime ($this_date); //converts date string to UNIX timestamp
$timestamp = $my_time + ($num_days * 86400); //calculates # of days passed ($num_days) * # seconds in a day (86400)
if($display==1){
$return_date = date("d-m-Y",$timestamp); //puts the UNIX timestamp back into string format
}else{
$return_date = date("Y-m-d",$timestamp); //puts the UNIX timestamp back into string format
}
return $return_date;//exit function and return string
}//end of function
i'm having this function.. which adds num days if i call it. It do work fine in my developing machine.. But not my web server.. Is there any one whom can help?
i did i try out..
The output date in my developing machine is 3-12-2006 whereas when i try it out when i save my stuffs in the web server else where.. It turns out to be 31-3-2007
hi there.. Thanks for the reply! i had tested it out.. but what it gave me was more 'future' date..
suppose to be 4/12/2006 but it turns out to be 31/5/2008 :(:( any more ideas?