how to get the difference in time as number of days?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

how to get the difference in time as number of days?

Post by susrisha »

i have two dates
$date1
and $date2
I want to know difference between these two dates in number of days.
How do i get it??
lettie_dude
Forum Commoner
Posts: 65
Joined: Thu Dec 07, 2006 10:10 am

Re: how to get the difference in time as number of days?

Post by lettie_dude »

Check out php.net

There is a function on this page to do exactly what you require.

http://uk.php.net/manual/en/function.mktime.php
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: how to get the difference in time as number of days?

Post by VladSun »

There are 10 types of people in this world, those who understand binary and those who don't
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

Re: how to get the difference in time as number of days?

Post by susrisha »

thanks alot for the replies.
I got my solution.
Post Reply