radioactive Posted November 7, 2011 Share Posted November 7, 2011 There are two things I want done. 1. Grab the current date in TIMESTAMP form and increase by a certain number of days as assigned by $days 2. Similar to the previous one, it will grab an already specified TIMESTAMP, and work from there All it echoes is 86400, which I assume is the number of seconds? <?php $days = 1; echo strtotime("+$days days", strtotime($date)); ?> Quote Link to comment https://forums.phpfreaks.com/topic/250596-increasing-dates/ Share on other sites More sharing options...
watsmyname Posted November 7, 2011 Share Posted November 7, 2011 hi <?php $daytoadd="+1 day"; $newdate=strtotime($daytoadd, strtotime(date("Y-m-d H:i:s"))); $newdate= date ( 'Y-m-d H:i:s' , $newdate); ?> This will add 1 day to the current date and returns date in Y-m-d H:i:s format, I hope this helps Quote Link to comment https://forums.phpfreaks.com/topic/250596-increasing-dates/#findComment-1285760 Share on other sites More sharing options...
radioactive Posted November 7, 2011 Author Share Posted November 7, 2011 Yes it does solve my problem, thank you. In a sense, I was headed in the right direction. Quote Link to comment https://forums.phpfreaks.com/topic/250596-increasing-dates/#findComment-1285774 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.