june_c21 Posted February 13, 2008 Share Posted February 13, 2008 hi, i doing a simple library system. just want to find out how to write code for due date? borrowing date + 14 days. How to do that? please help. thanks Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted February 13, 2008 Share Posted February 13, 2008 <?php $borrowed_date = "2008-02-01"; $due_date = date("Y-m-d", strtotime($borrowed_date . "+ 14 DAY")); echo "The book is due back on <b>$due_date</b>"; ?> Quote Link to comment Share on other sites More sharing options...
june_c21 Posted February 13, 2008 Author Share Posted February 13, 2008 when i wrote 2008-02-01 it came out 2008-Feb-Fri instead of 2008-02-15. How to solve this? Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted February 13, 2008 Share Posted February 13, 2008 Because you changed this part - "Y-m-d" to something else. Use the code that pocobueno1388 posted. Quote Link to comment Share on other sites More sharing options...
june_c21 Posted February 13, 2008 Author Share Posted February 13, 2008 i am using Y-m-d(2008-02-01). but the result still 2008-Feb-Fri ... Quote Link to comment Share on other sites More sharing options...
june_c21 Posted February 13, 2008 Author Share Posted February 13, 2008 -SOLVED- Quote Link to comment 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.