我正在处理涉及日期的任务。我有一个person's age in months+days。现在我想知道这个人在几个月内达到特定年龄的日期。PHP:如何获得一个人达到特定年龄的日期?
例如:
A person is 250 months and 15 days old on 2010-1-25.
On which date this person will become 300 months old?
函数签名可能是:
function getReqDate($startDate, $currAgeMonths, $currAgeDays, $reqAgeMonths ) {
//return date
}
不是一个答案,但有你需要闰年重新做一个思考:你的规格。 – Tobiasopdenbrouw 2010-07-26 09:45:18
并考虑到(2月除外)其他月份有30天和31天。 – ubiquibacon 2010-07-26 10:10:12