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,
If i executed code then nothing will be displayed...
-Uma
On Tue, 19 Feb 2002, Andrey Hristov wrote:
AH>Try this :
AH>$d1=strtotime('d-m-Y',$str);
AH>$d2=strtotime('d-m-Y',$str1);
AH>var_dump($d2-$d1);
AH>
AH>
AH>Best regards,
AH>Andrey Hristov
AH>
AH>- Original Message
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 10:50 AM
Subject: [PHP] Difference between two
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 dates
>
>
> Hello,
>
8 matches
Mail list logo