jeff5656 Posted November 16, 2010 Share Posted November 16, 2010 I can determine 3 years from today, but How do determineo 3 years from march 1st? So I want to echo out "3/1/2013"? Thanks! Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted November 16, 2010 Share Posted November 16, 2010 date('m/d/Y', strtotime('3/1/2010 +3 years')); Quote Link to comment Share on other sites More sharing options...
jeff5656 Posted November 16, 2010 Author Share Posted November 16, 2010 Well the problem with that is that it assumes the current year is 2010. This wouldn't work next year right? (because it assumes 3/1/2010) Quote Link to comment Share on other sites More sharing options...
simshaun Posted November 16, 2010 Share Posted November 16, 2010 So you want 3 years from the current year? echo date('Y-m-d', strtotime('March 1 + 3 years')); Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted November 16, 2010 Share Posted November 16, 2010 Well the problem with that is that it assumes the current year is 2010. This wouldn't work next year right? (because it assumes 3/1/2010) Use what simshaum showed or this is easier if you always want 3 years from 3/1/current_year: '3/1/'.(date('Y')+3); I was assuming that you had the start date in a variable or something and wanted to do a calculation. Quote Link to comment Share on other sites More sharing options...
jeff5656 Posted November 16, 2010 Author Share Posted November 16, 2010 Thanks guys! Quote Link to comment 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.