How to Addding 1 Year with PHP

How to Addding 1 Year with PHP

Hi,

I am very fresh in PHP language. I trying to create a small application about how to adding 1 year in specific date. Please suggest me.

Thanks,

View Answers

February 10, 2011 at 10:27 AM

Hi,

In PHP provides method to add 1 year easily. The syntax given below will show how to add 1 year in php program. This may be help you to develop the application.

Example : ---

<?php

//Example to add 1 year to a date object

$currentDate = date("Y-m-d");// current date

//Display the current date
echo "Current Date: ".$currentDate."<br>";

//Add one year to current date
$dateOneYearAdded = strtotime(date("Y-m-d", strtotime($currentDate)) . " +1 year");
echo "Date After adding one year: ".date('l dS \o\f F Y', $dateOneYearAdded)."<br>";

?>









Related Tutorials/Questions & Answers:
How to Addding 1 Year with PHP
How to Addding 1 Year with PHP  Hi, I am very fresh in PHP language. I trying to create a small application about how to adding 1 year in specific date. Please suggest me. Thanks
How to Addding One Month with PHP ?
How to Addding One Month with PHP ?  Hi, I am very new in this php programming language. Can anybody will guide me how to add 1 month on a specific date on PHP. Please give any example or reference links. Please feel free
Advertisements
PHP Date add 1 year
to add 1 year easily. The code given below will show how you can add 1 year in php program. <?php //Example to add 1 year to a date objectADS... Adding 1 year to a php date object is sometimes useful to solve some
PHP Date add 1 month
PHP Date add 1 month This example shows you how one month can be added... to add 1 month:ADS_TO_REPLACE_1 <?php //PHP Example code to add one...;, strtotime($todayDate)) . "+1 month"); echo "After adding one month
data science 1 year course
data science 1 year course  Hi, I am beginner in Data Science... 1 year course Try to provide me good examples or tutorials links so that I can learn the topic "data science 1 year course". Also tell me which
1 year masters in artificial intelligence
1 year masters in artificial intelligence  Hi, I am beginner in Data...: 1 year masters in artificial intelligence Try to provide me good examples or tutorials links so that I can learn the topic "1 year masters
1 year data science masters
1 year data science masters  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: 1 year data... can learn the topic "1 year data science masters". Also tell me which
1 year masters in data science
1 year masters in data science  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: 1 year... that I can learn the topic "1 year masters in data science". Also tell
data science 1 year masters
data science 1 year masters  Hi, I am beginner in Data Science... science 1 year masters Try to provide me good examples or tutorials links so that I can learn the topic "data science 1 year masters". Also tell me which
1 year masters data science
1 year masters data science  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: 1 year... can learn the topic "1 year masters data science". Also tell me which
masters in data science 1 year
in data science 1 year Try to provide me good examples or tutorials links so that I can learn the topic "masters in data science 1 year". Also tell...masters in data science 1 year  Hi, I am beginner in Data Science
1 year masters programs in data science
1 year masters programs in data science  Hi, I am beginner in Data...: 1 year masters programs in data science Try to provide me good examples or tutorials links so that I can learn the topic "1 year masters programs
How to calculate days in a year
How to calculate days in a year  Hi, How to calculate no of days in a year? I want a program that calculates no of days in a year by specifying year... of calculating days in a year? Thanks
PHP Date add 1 hour
In the following example code we are showing how you can add one hour to a date object. <?phpADS_TO_REPLACE_1 //This PHP Example code shows how to add one hour to a date object $todayDate = date("Y-m-d g:i a"
PHP Date add 1 day
PHP Date add 1 day This simple code will tell you how you can easily add 1 day to a date.  Example code for PHP Date add 1 day:ADS_TO_REPLACE_1 <?php $todayDate = date("Y-m-d");// current date echo "
how to display(update) current date and month in select box on selecting the year.
how to display(update) current date and month in select box on selecting the year.  how to display(update) current date and month in select box on selecting the year
how to put php in javascript
how to put php in javascript  How to write a javascript code inside php block
How to learn PHP
How to learn PHP  Hi, PHP seem easy language and beginners can find jobs in PHP easily. How to learn PHP? Thanks   Hi, You can learn PHP easily and we have 1000s of tutorials to teach you PHP. Check: PHP Tutorials
JSP:How to get year of system date - Date Calendar
JSP:How to get year of system date  Please tell me how to get year...=Calendar.getInstance(); int year=cal.get(Calendar.YEAR); System.out.println("Current Year: "+year ); } } For more Examples on Java visit to : http
how to use calender in php
how to use calender in php  how to put calender in php
how to update image in php
how to update image in php  how to update image in php
PHP Date add 1 week
The PHP Date add 1 week example code. In the the following example code we will show you how to add one week to any date object in the PHP program. <?phpADS_TO_REPLACE_1 //Example to add 1 week to a date object
How to learn PHP?
How to learn PHP?  Hi, How I can learn PHP easily? ThanksADS...://www.roseindia.net/php/ADS_TO_REPLACE_2 Thanks  Hi Friend, Please visit the following link:ADS_TO_REPLACE_3 http://www.roseindia.net/php/ Thanks
leap year
leap year  how to create class for leap year. It is leap year... static boolean isLeapYear(int year) { if (year < 0) { return false; } if (year % 4 == 0) { return true; } else if (year % 400 == 0
How to Prepend Array in PHP
How to Prepend Array in PHP  hi, How can i prepand array in PHP. Please suggest any example of prepand array in PHP program. Thanks,   Hi, The PHP prepand array function in used before adding any elements
How to become a PHP Developer?
. To become a PHP developer following the following steps:ADS_TO_REPLACE_1 How to become PHP Developer? a) PHP Basics Steps 1: Downloading and installing... PHP 5.0. Installation and at How to Install WAMP Server on XP and Windows
JDBC : Get year from Date
JDBC : Get year from Date In this section, you will learn how to get year from date. Get year from Date : In MySql you can get year from the given Date by using year() function.ADS_TO_REPLACE_1  YEAR(date) : This method returns
How to Create Dynamic URLs in PHP?
How to Create Dynamic URLs in PHP?  How to Create Dynamic URLs in PHP
How to Find PHP version and configuration?
How to Find PHP version and configuration?  Find PHP version and configuration   If you want to find the version of PHP, you can just run the php command with php -v. Run PHP Command: $ php -v you can also check
How to convert date to time in PHP?
How to convert date to time in PHP?  Hi, programmer. The PHP... and time. The PHP "time()" function is used to get the current Unix timestamp, a number representing the number of seconds since January 1, 1970 Greenwich Mean
php
php using javasript  how to set timer in php using javasript
How to use the PHP filetype() Function
How to use the PHP filetype() Function  Hi, What is the use of filetype() Function in php programming. Can anyone give any online example of the PHP filetype() Function. Thanks
How to Create Multiplication Table from 1 to 10?
How to Create Multiplication Table from 1 to 10?  Hi, I want to develop an small application store products. So, i how to create multiplication table 1 to 10. Please suggest online example related to creating multiplication
How to list even numbers between 1 and 100?
How to list even numbers between 1 and 100?  Hi, I Java to check if a number is even? How to list even numbers between 1 and 100? Thanks  ... the numbers between 1 and 100 for (int i=1;i <=num ; i++){ if(i%2==0
how to divide 1 web page into some parts...
how to divide 1 web page into some parts...  how to divide 1 web page into some parts...i know it using frames in html,bt how can we do it in jsp... home page,bt m nt knowing how to divide that into frames in jsp.   <
how to divide 1 web page into some parts...
how to divide 1 web page into some parts...  how to divide 1 web page into some parts...i know it using frames in html,bt how can we do it in jsp... home page,bt m nt knowing how to divide that into frames in jsp.  <
How to destory session in PHP
How to destory session in PHP  Hi, I have to write a php page for logout. Please tell me what i should write? ThanksADS_TO_REPLACE_1   Hi, You can use following code for logout: <? session_start(); session
PHP
PHP  How to work in drupal with PHP
How to retrieve the ISO Date in PHP?
How to retrieve the ISO Date in PHP?  Hi, I am a beginner in PHP programming language. I have a query how to retrieve the ISO Date in PHP Language. Can any one suggest any reference for this. Thanks
How to Declare Abstract Class in PHP ?
How to Declare Abstract Class in PHP ?  hi, I am a PHP Beginners. As i am trying to make an application where i trying to declare the abstract class of PHP. Please any one explain me how to declare abstract class in PHP program
How to Create Instance using PHP
How to Create Instance using PHP  Hi, How to create an instance class in PHP program. Can someone explain or suggest any online reference how to create an Instance class in PHP. Thanks, (adsbygoogle
Sitemap PHP Tutorial
Date add 1 month | PHP Date add 1 hour | PHP Date add 1 year | PHP Date add 1 week | PHP date add, PHP Date addition to a date object | PHP Date... Date add 1 day | Check Date in PHP | PHP date add function | PHP date
php
php  how to write a program in php to create pdf file
how to connect to database in php using mysql
how to connect to database in php using mysql  how to connect to database in php using mysql
how to post data in mysql php form
how to post data in mysql php form  how to post data in mysql php form
how to create a php script to download file
how to create a php script to download file  php script to download file
Mysql Year of Date
Mysql Year of Date       Mysql Year of Date is used to return the current year of the table... from 'Mysql Year of Date'. To understand and grasp the example we use
php
warning as mysqlfetcharray() expects parameter 1 to be resource, boolean given... with error.Query was empty plz help me how to remove... can learn php mysql connectivity
php
php   what is php   PHP Tutorials
How to Declare fflush() Function in PHP
How to Declare fflush() Function in PHP  Hi, Can someone give my any online example for write all the buffered data of an open file. Is it appropriate to use the PHP fflush() Function to develop this application? Please suggest

Ads