ShootingBlanks Posted November 16, 2007 Share Posted November 16, 2007 How do I amend this statement to make it so that the variable $newDate is 2-years later than today's current date?: <?php $newDate = date('Y-m-d'); ?> I tried: $newDate = (date('Y-m-d') + 730); But that didn't work. Thanks! Link to comment https://forums.phpfreaks.com/topic/77648-solved-getting-a-date-2-years-in-the-future/ Share on other sites More sharing options...
pocobueno1388 Posted November 16, 2007 Share Posted November 16, 2007 <?php $twoYear = date('Y-m-d', strtotime ("+ 2 year")); echo $twoYear; ?> Link to comment https://forums.phpfreaks.com/topic/77648-solved-getting-a-date-2-years-in-the-future/#findComment-393052 Share on other sites More sharing options...
ShootingBlanks Posted November 16, 2007 Author Share Posted November 16, 2007 Perfect - thanks! Link to comment https://forums.phpfreaks.com/topic/77648-solved-getting-a-date-2-years-in-the-future/#findComment-393069 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.