Calculating difference between years

I needed to create a dropdown list that had all the years back to a certain date. To accomplish this I would need to calculate difference between years back to the specified date. This isn’t really a difficult but here is the code just incase anyone else needs to do the same.

Here is how I did it:


Pretty simple right? Not sure if there is a better way, but this seems to give me what I needed.


Leave a Reply

Your email address will not be published. Required fields are marked *

Enter Captcha Here : *

Reload Image