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
"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
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
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"
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
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
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>
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
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
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
10 matches
Mail list logo