stuart, what LS has given you will work (for the most part), but there are 2 factors to keep in mind here...
1) The script doesn't account for leap years.
2) If the person was married before January 1, 1970, the strtotime function won't work.
Post more details about what kind of dates you will be using, and I'm sure LS's code can be tweaked a bit for you...