Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to calculate dates > 1-19-2038 ?

Status
Not open for further replies.

DavidRock

Programmer
Jul 24, 2002
61
US
Hello,
I need to add 65 years to a birth date to compute the retirement date for an individual. I need to take leap years into account and was using the following example which fails when the result is > 1-19-2038:

$retire = strtotime("1974-01-06 + 65 years");

Is there a workaround I can use that takes leap years into account?

Thanks for your help,
David
 
Have you searched for a PHP extention willl do long dates ?, if one doesn't exist I would the calculations are straight forward and could be implemented quite easily.
 
Thanks for the responses. I installed the PEAR Date and Calendar classes and looked through them but don't see a function to calculate a future date that's years in the future. Is it there and I'm just missing it?

Thanks for pointing me to PEAR btw, looks like lots of good stuff there.

Thanks
 
Thank you sleipnir214, those functions sound like exactly what I need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top