Home Answers Viewqa PHP How to Addding 1 Year with PHP

 
 


Vinod
How to Addding 1 Year with PHP
1 Answer(s)      2 years and 3 months ago
Posted in : 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 Pages:
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
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 object... 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: <?php //PHP Example code to add one moth to a date... $dateOneMonthAdded = strtotime(date("Y-m-d", strtotime($todayDate)) . "+1
JSP Financial Year Table
JSP Financial Year Table  Im trying to design a financial year table... separately.also suugest me a code on how to iterate through all the fields. HashMap april= new HashMap(); april.put("aprMS",new Integer(1)); april.put
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.  YEAR(date) : This method returns the year
leap year
leap year  how to create class for leap year. It is leap year... isLeapYear(int year) { if (year < 0) { return false; } if (year % 4 == 0) { return true; } else if (year % 400 == 0) { return
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. <?php //Example to add 1 week to a date object $currentDate = date
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: <?php...("Y-m-d", strtotime($todayDate)) . " +1 day"); echo "
PHP Date add 1 hour
In the following example code we are showing how you can add one hour to a date object. <?php //This PHP Example code shows how to add one hour to a date object $todayDate = date("Y-m-d g:i a");// current
Discounted Website, 50% Discount on website,Website Rs. 5000/- a year!
: 09313063554 Email: deepak@roseindia.net How to Buy? Payment Option 1 PAY... Get Website for your business! Only for Rs. 5000 a year! Get.... With your website you will get: 1. Domain name worth Rs. 500/- 2. Web space
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
Leap Year Program
Java NotesLeap Year Program This program reads a year and tells the user if it's a leap year or not. It uses boolean operators instead of if statements, which would also be a perfectly fine solution. 1 2
Mysql Year of Date
Mysql Year of Date       Mysql Year of Date is used to return the current year of the table in database. Understand with Example The Tutorial illustrate an example from 'Mysql Year
Mysql Date Add Year
Year'. To graspe this example, we use Add('2008-12-15',INTERVAL 1 YEAR) query that add a 1 Year to the particular date.  SYNTAX:-ADDDATE(date,INTERVAL... 1YEAR) add a 1 year interval to the particular date. SELECT DATE_ADD
name of year in chinese
name of year in chinese   hello my name kiemtheng i'm come from Cambodia, i would to write java programming to calculate a name of year for each birthday in Chinese but i dont know how to do.   import java.util.
name of year in chinese
name of year in chinese   hello my name kiemtheng i'm come from Cambodia, i would to write java programming to calculate a name of year for each birthday in Chinese but i dont know how to do.   import java.util.
Sitemap PHP Tutorial
_format function | PHP Date() Function | PHP Date add 1 month | PHP Date add 1 hour | PHP Date add 1 year | PHP Date add 1 week | PHP date add... Date and Time | PHP Date add days | PHP Date add 1 day | Check Date
PHP Registering simple statistics
! In this tutorial I will teach you how to make a simple PHP Script that writes... PHP Registering simple statistics Have you ever wanted to know who visited... that they visited ! This program follows a simple algorithm as follows: 1. Grab
PHP
to the users. History of PHP Rasmus Lerdof created a language in the Year 1995.... Then PHP/FI 2.0 was introduced. In the year 1997 PHP 3 was released with many...PHP PHP stands for Hypertext Preprocessor; PHP is server-side scripting
End of Year Puzzle
= new LittleFuzzy(); System.out.println(littleFuzzy.method(10)); } } 1
Java get Year
Java get Year       In this section, you will learn how to obtain the current year. The Calendar.... The method cal.get(Calendar.YEAR) will return the current year. Here
php
php using javasript  how to set timer in php using javasript
PHP
PHP  How to work in drupal with PHP
Add year to Date without using Calendar in java
Add year to Date without using Calendar in java  how could i add a year to a date function without using calendar functions
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 Array
PHP Array In this page we will learn about PHP Array. We will also understand how to use PHP Array in your PHP program. The PHP Array is very useful in developing PHP based applications. PHP Arrays are ordered map which is used
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
php
php  how to write a program in php to create pdf file
Retrieve all the students in the same year(Java ArrayList)?
); if(search != null){//if found 1 student by year do{//Search all students...Retrieve all the students in the same year(Java ArrayList)?  FoundStudents.jsp year- parameter I receive from a form search- is an object of type
How to become a PHP Developer?
. To become a PHP developer following the following steps: How to become PHP Developer? a) PHP Basics Steps 1: Downloading and installing PHP environment... downloading and installing WAMP server at our PHP 5.0. Installation and at How
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
php
php  How to catch a image and link click counters using Ajax php can any one help me
php
php  how to set email remainder in php?can you help me pls
function 1 - Java Beginners
function 1  WAP to calculate the value of x,where x=tan(A)+tan(B)/1+tan(A)*tab(B)  Give more details like how to calculate and what is tan(A) and tan(B),etc
Java get year from date
Java get year from date       In this section you will study how to retrieve the year from... showing the format of year. The method simpleDateformat.format(date) formats
PHP
PHP  I would love to do PHP project with the title of "Hospital Management System". I want to know how to make validation using jquery
Year Format Example
Year Format Example       This example shows how to format Year using Format class. In this program we use a pattern of special characters to format week day. Description
contructors 1&test
contructors 1&test   how do i Create a class named Box that includes integer data fields for length, width and height. Create three constructors... created with length 10 and width 15. Box created with length 1, width 2
problem 1 - Java Beginners
problem 1   Hi, please help me!!!! How can i code in java using Two-dimensional Arrays? This question is related to the one i posted before. this is my input data file: 88 90 94 102 111 122 134 75 77 80 86 94 103 113 80
PHP Date function
; it is tenth month of the year PHP Date formatting example code: <?php...PHP Date Function In this section we will show you the different formatting options available in the PHP Date function PHP date() function provides many
C++ quuestion 1
C++ How to dispaly details for students and Create object for student class and input dispaly details   1.Create a class called student with following descriptions Data member : Rno - int Name - char[20] Std - int Mark1 int
Logging Tutorial - Part 1
Logging Tutorial - Part 1 2000-12-14 The Java Specialists' Newsletter [Issue 003] - Logging part 1 Author: Dr. Heinz M. Kabutz If you are reading... information. Logging Part 1 of ... (haven't decided yet ;-) While we
problem 1 = C#
C# how to calculate discount   We are selling Monitors. We have decided to give discounts based on the following items. i. CRT monitors attract 10% discount User is required to provide all the details mentioned
data insertion and fetch 1
data insertion and fetch 1  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html>...; } @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@222 how to fetch
For Loop/PHP
at 1 and multiply all of the integers to num. If num is 5 then you would multiply 12345. How would you write this as a loop? Would I need to use the for loop or do/while loop?   PHP Factorial Example: <?php $n = 5; $i = 1; $f
PHP date function
. timestamp : It specifies the timestamp by default. Example 1How to get...PHP Date() Function PHP Date() function is used to display the date and time in a précised format.  With the help of PHP date function you can format
PHP SQL Timestamp
PHP SQL Timestamp       This example illustrates how to create a timestamp type column. In this example the PHP date() function formats a timestamp to a more readable date
convert date month and year into word using java
); int month = cal.get(Calendar.MONTH) + 1; int year = cal.get...convert date month and year into word using java  convert the date, month,year into word like 12-3-2012 into twelve march two thousands twelve pls
convert date month and year into word using java
); int month = cal.get(Calendar.MONTH) + 1; int year = cal.get...convert date month and year into word using java  convert the date, month,year into word like 12-3-2012 into twelve march two thousands twelve pls

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.