dc_jt Posted January 7, 2010 Share Posted January 7, 2010 Hi Ive got a form which has a "Years" and a "Months" field where a user enters the number of years and months they have been at their residential address. However, the form must have at least 3 years record of their residential history, therefore they can add multiple addresses. What I need to work out is when they get to the 3 years. To do this, would I turn the years into months i.e 1 = 12, 2 = 24 etc and add this to the number of months? Then work out if this total is equal to or greater than 36 (3 years)? Is this the best way to do it or is there a better alternative? Also, how would I represent this in PHP? Thanks! Link to comment https://forums.phpfreaks.com/topic/187551-calculating-number-of-years/ Share on other sites More sharing options...
cags Posted January 7, 2010 Share Posted January 7, 2010 The method you suggest seems as good as any. How you would represent it in PHP would be very much dependent on what code you currently have and how you are representing the data. Link to comment https://forums.phpfreaks.com/topic/187551-calculating-number-of-years/#findComment-990234 Share on other sites More sharing options...
Deoctor Posted January 7, 2010 Share Posted January 7, 2010 i think wt ever u are thinking is the right one Link to comment https://forums.phpfreaks.com/topic/187551-calculating-number-of-years/#findComment-990261 Share on other sites More sharing options...
dc_jt Posted January 7, 2010 Author Share Posted January 7, 2010 Thanks for your help. Link to comment https://forums.phpfreaks.com/topic/187551-calculating-number-of-years/#findComment-990265 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.