jj20051 Posted July 14, 2010 Share Posted July 14, 2010 How would I go about adding 7 days to the current date in php? I understand that I can use the date function and then add 7 to it, but the problem with that is it doesn't round up to the next month. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/207683-adding-7-to-the-date/ Share on other sites More sharing options...
Pikachu2000 Posted July 14, 2010 Share Posted July 14, 2010 What format is it in, and where does it come from, a database query? Quote Link to comment https://forums.phpfreaks.com/topic/207683-adding-7-to-the-date/#findComment-1085686 Share on other sites More sharing options...
corbin Posted July 14, 2010 Share Posted July 14, 2010 date() and strtotime() would probably do the trick . Edit: Oh, I should probably note that strtotime can handle stuff like: strtotime('July 1, 2010 +1 week'); Also, mktime() might be useful. Quote Link to comment https://forums.phpfreaks.com/topic/207683-adding-7-to-the-date/#findComment-1085688 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.