oceans Posted April 30, 2007 Share Posted April 30, 2007 Dear People, Can any one please help me in adding days to date: I want to find the date, if I add 10 days to today’s date. I have done this in ASP, but in PHP, I could not locate the function call, please guide me, I hope the function will return the date(20 March 2007) and the day (eg Monday) as well. Link to comment https://forums.phpfreaks.com/topic/49243-solved-can-any-one-please-help-me-in-adding-days-to-date/ Share on other sites More sharing options...
snowdog Posted April 30, 2007 Share Posted April 30, 2007 $date = date("Y-m-d", strtotime("+2 days")); // will return date two days from now as 2007-05-01 $date = date("l, F j, Y", strtotime("+2 days")); // will return date two days from now as Tuesday, May 1, 2007 Snowdog Link to comment https://forums.phpfreaks.com/topic/49243-solved-can-any-one-please-help-me-in-adding-days-to-date/#findComment-241296 Share on other sites More sharing options...
oceans Posted April 30, 2007 Author Share Posted April 30, 2007 Dear Snowdog, I managed to fix it too, I used the following: <?PHP $DaysToForward=0; $ForwardedDate= mktime(0,0,0,date("m"),date("d")+$DaysToForward,date("Y")); echo date("Y-m-d (l)", $ForwardedDate); ?> Thanks for your help. Link to comment https://forums.phpfreaks.com/topic/49243-solved-can-any-one-please-help-me-in-adding-days-to-date/#findComment-241298 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.