php add year to date – How to Add Year to Date in PHP?

php add year to date and display it. The PHP date function is used to format a date. here we can learn to main 2 Examples.

php add year to date

Adding Year to $current_date can be done in many ways. The following source code will php added year to date.

Example 1: PHP Added Year to Date

php_add_year_to_date.php

<?php
  
    $myJoinDt = "2022-02-01";
    $latestDt = date('Y-m-d', strtotime($myJoinDt. ' + 5 years'));
  
    echo $latestDt;
  
?>

Result

2027-02-01

Free Live Chat for Any Issue

don’t miss : Add Months To Date

Also Read This πŸ‘‰   PHP Split Export convert Multiple Excel Sheet Files

Example 2: PHP Add Year to Current Date

php_add_year_to_current_date.php

<?php
  
    $latestDt = date('Y-m-d', strtotime(' + 5 years'));
  
    echo $latestDt;
  
?>

Result

2026-03-01

I hope you get an idea about php add year to date.
I would like to have feedback on my infinityknow.com.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Rate this post