How to calculate the difference between two dates using PHP

0 votes

I have two dates on the form:

Start Date: 2007-03-24 
End Date: 2009-06-26

I want to find the difference between these two in the following form:

2 years, 3 months and 2 days

How can I do this in PHP?

Jun 24 in PHP by narikkadan
• 20,080 points
13 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
1 answer

How to retrieve or obtain data from the MySQL database using PHP?

Hello kartik,  Actually there are many functions that  ...READ MORE

answered Mar 27, 2020 in PHP by Niroj
• 82,780 points
1,438 views
0 votes
1 answer

How to get the list of specific files in a directory using php?

Hello @kartik, You'll be wanting to use glob() Example: $files = ...READ MORE

answered Nov 6, 2020 in PHP by Niroj
• 82,780 points
401 views
0 votes
0 answers

How to reverse an array in php WITHOUT using the array reverse method

I have an array called reverse array ...READ MORE

Jun 12 in PHP by narikkadan
• 20,080 points
136 views
0 votes
0 answers

How to pass a PHP variable using the URL

I need to pass some PHP variables ...READ MORE

Jun 19 in PHP by narikkadan
• 20,080 points
122 views
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
5,026 views
0 votes
1 answer

How to send email using php?

Hello @kartik 1.) Download PHPMailer, open the zip file ...READ MORE

answered Apr 1, 2020 in PHP by Niroj
• 82,780 points
525 views
0 votes
1 answer

How do I get the current date and time in PHP?

The time would go by your server ...READ MORE

answered Feb 16 in Others by Aditya
• 7,660 points
49 views
0 votes
0 answers

What php timezone I use for San Francisco, California, United Stated

What PHP time zone can I use ...READ MORE

May 27 in PHP by Kichu
• 19,040 points
61 views
0 votes
0 answers

Convert one date format into another in PHP

How can I convert one date format ...READ MORE

Jun 20 in PHP by Kithuzzz
• 11,840 points
19 views
0 votes
0 answers

php convert date to mktime function

I posted a date input $_POST['date'] with format 2013/11/22 and time $_POST['time'] with ...READ MORE

Jun 27 in PHP by narikkadan
• 20,080 points
46 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP