Letter Letter - 2 years ago 178
PHP Question

Php date add 1 year to current date

I have this php code right here:


I use it in order to get current date, i need to add 5 years to the current date, something like:

$end=date('(Y + 5)-m-d');

Someone help me how to achieve it?

hsz hsz
Answer Source

Try with:

$end = date('Y-m-d', strtotime('+5 years'));
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download