ebchost Posted December 14, 2011 Share Posted December 14, 2011 if the date of selling goods " $date = "2011/06/05"; and if we have payment after of $days = "15"; - (15 days), how to calculate when the last day for payment? Quote Link to comment https://forums.phpfreaks.com/topic/253143-when-is-the-date-for-payment/ Share on other sites More sharing options...
kney Posted December 14, 2011 Share Posted December 14, 2011 <?php $date = "2011/06/05"; $newDate = strtotime('+15 days',$date); ?> Quote Link to comment https://forums.phpfreaks.com/topic/253143-when-is-the-date-for-payment/#findComment-1297758 Share on other sites More sharing options...
xyph Posted December 14, 2011 Share Posted December 14, 2011 Close, but not quite. $date = strtotime( '2011/06/05' ); $new = date( 'Y/m/d', $date + (60*60*24*15) ); Quote Link to comment https://forums.phpfreaks.com/topic/253143-when-is-the-date-for-payment/#findComment-1297759 Share on other sites More sharing options...
ebchost Posted December 14, 2011 Author Share Posted December 14, 2011 Close, but not quite. $date = strtotime( '2011/06/05' ); $new = date( 'Y/m/d', $date + (60*60*24*15) ); thanks for this code, that solved my problem $date = strtotime($date); $new = date( 'Y/m/d', $date + (60*60*24*$days) ); Quote Link to comment https://forums.phpfreaks.com/topic/253143-when-is-the-date-for-payment/#findComment-1297762 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.