Re: Difference between two dates
| From: | Uma Shankari T. | Date: | Wed, 20 Feb 2002 06:31:12 +0000 |
| Subject: | Re: Difference between two dates | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-85502@lists.php.net to get a copy of this message | ||
If i gave the str date as "31-01-2001"; and $str1="04-02-2001"; then it
is displaying the wrong result
Plz tell me how can i rectify this problem...
-Uma
On Tue, 19 Feb 2002, Rasmus Lerdorf wrote:
RL>This will give you the difference between the two dates in seconds:
RL>
RL>$diff = strtotime(str_replace('-','/',$str1)) -
RL>strtotime(str_replace('-','/',$str));
RL>
RL>-Rasmus
RL>
RL>On Wed, 20 Feb 2002, Uma Shankari T. wrote:
RL>
RL>>
RL>>
RL>>
RL>> Hello,
RL>>
RL>> How can i find out the difference between two dates.
RL>>
RL>> I am having the date like this
RL>>
RL>> $str="10-01-2001";
RL>> $str1="01-02-2002";
RL>>
RL>> I need to find out the difference between the date,month and year.
RL>>
RL>> If anyone know the solution for this problem plz tell me
RL>>
RL>>
RL>> -Uma
RL>>
RL>>
RL>>
RL>> --
RL>> PHP General Mailing List (http://www.php.net/)
RL>> To unsubscribe, visit: http://www.php.net/unsub.php
RL>>
RL>
--
Love and you shall be loved by others