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 Link to comment https://forums.phpfreaks.com/topic/90843-due-date/ 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>"; ?> Link to comment https://forums.phpfreaks.com/topic/90843-due-date/#findComment-465614 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? Link to comment https://forums.phpfreaks.com/topic/90843-due-date/#findComment-465646 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. Link to comment https://forums.phpfreaks.com/topic/90843-due-date/#findComment-465653 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 ... Link to comment https://forums.phpfreaks.com/topic/90843-due-date/#findComment-465710 Share on other sites More sharing options...
june_c21 Posted February 13, 2008 Author Share Posted February 13, 2008 -SOLVED- Link to comment https://forums.phpfreaks.com/topic/90843-due-date/#findComment-465762 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.