Re: [PHP] Difference between two dates

2002-02-20 Thread Uma Shankari T.
Hello, I got the solution for the date difference problem..,, Thankyou very much. -Uma "Uma Shankari T." <[EMAIL PROTECTED]> wrote: > 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 p

Re: [PHP] Difference between two dates

2002-02-20 Thread Steve Werby
"Uma Shankari T." <[EMAIL PROTECTED]> wrote: > 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, I wrote a function last year that calculates the time between 2 dates in whatever unit i

Re: [PHP] Difference between two dates

2002-02-19 Thread Uma Shankari T.
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

Re: [PHP] Difference between two dates

2002-02-19 Thread Steven Walker
You can convert the time into seconds using mktime(), subtract one from the other, and then reformat it using gmstrftime: //int mktime ( int hour, int minute, int second, int month, int day, int year [, int is_dst]) //string gmstrftime ( string format [, int timestamp]) "; echo "$time2"

Re: [PHP] Difference between two dates

2002-02-19 Thread Rasmus Lerdorf
This will give you the difference between the two dates in seconds: $diff = strtotime(str_replace('-','/',$str1)) - strtotime(str_replace('-','/',$str)); -Rasmus On Wed, 20 Feb 2002, Uma Shankari T. wrote: > > > > Hello, > > How can i find out the difference between two dates. > > I am h

[PHP] Difference between two dates

2002-02-19 Thread Uma Shankari T.
Hello, How can i find out the difference between two dates. I am having the date like this $str="10-01-2001"; $str1="01-02-2002"; I need to find out the difference between the date,month and year. If anyone know the solution for this problem plz tell me -Uma -- PHP General Mai

Re: [PHP] Difference between two dates

2002-02-19 Thread Uma Shankari T.
Andrey Hristov AH> AH>- Original Message - AH>From: "Uma Shankari T." <[EMAIL PROTECTED]> AH>To: <[EMAIL PROTECTED]> AH>Sent: Tuesday, February 19, 2002 10:50 AM AH>Subject: [PHP] Difference between two dates AH> AH> AH>> AH>> AH>

Re: [PHP] Difference between two dates

2002-02-19 Thread Andrey Hristov
Try this : $d1=strtotime('d-m-Y',$str); $d2=strtotime('d-m-Y',$str1); var_dump($d2-$d1); Best regards, Andrey Hristov - Original Message - From: "Uma Shankari T." <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 19, 2002

Re: [PHP] Difference between two dates

2002-02-19 Thread Daniel Alsén
Read this article at PHPbuilder: http://www.phpbuilder.com/columns/akent2610.php3 - D - Original Message - From: "Uma Shankari T." <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 19, 2002 9:50 AM Subject: [PHP] Difference between two

[PHP] Difference between two dates

2002-02-19 Thread Uma Shankari T.
Hello, How can i find out the difference between two dates. I am having the date like this $str="10-01-2001"; $str1="01-02-2002"; I need to find out the difference between the date,month and year. If anyone know the solution for this problem plz tell me -Uma -- PHP General Maili