jigsawsoul Posted April 2, 2010 Share Posted April 2, 2010 I'm having problems knowing where to start, the delivery date on my website will be, 6 days from the current date.. How would i get todays date, the add six day's to that date and display the new date..??? If you understand at all what i mean.. thanks for any help..! Link to comment https://forums.phpfreaks.com/topic/197356-adding-six-days-to-the-current-date/ Share on other sites More sharing options...
Garethp Posted April 2, 2010 Share Posted April 2, 2010 $Now = time(); $SixDays = 1 * 60 * 60 * 24 * 6; $Wanted = $Now + $SixDays; $Wanted = date("d/m/Y", $Wanted); Link to comment https://forums.phpfreaks.com/topic/197356-adding-six-days-to-the-current-date/#findComment-1035889 Share on other sites More sharing options...
TeddyKiller Posted April 2, 2010 Share Posted April 2, 2010 //Garethp's code with comments $Now = time(); //Current timestamp $SixDays = 1 * 60 * 60 * 24 * 6; // 1 x 60seconds x 60minutes x 24 hours x 6 days = seconds in 6 days $Wanted = $Now + $SixDays; //Adding seconds in 6 days onto current time stamp $Wanted = date("d/m/Y", $Wanted); //Creating it in date format Link to comment https://forums.phpfreaks.com/topic/197356-adding-six-days-to-the-current-date/#findComment-1035891 Share on other sites More sharing options...
jigsawsoul Posted April 2, 2010 Author Share Posted April 2, 2010 $Now = time(); $SixDays = 1 * 60 * 60 * 24 * 2; $Wanted = $Now + $SixDays; $Wanted = date("d/m/Y", $Wanted); is the above correct if i only want to add two days? Link to comment https://forums.phpfreaks.com/topic/197356-adding-six-days-to-the-current-date/#findComment-1035896 Share on other sites More sharing options...
TeddyKiller Posted April 2, 2010 Share Posted April 2, 2010 Yes. It is correct. Link to comment https://forums.phpfreaks.com/topic/197356-adding-six-days-to-the-current-date/#findComment-1035897 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.