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 is preferred
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 problem...
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 Mailing
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,
How
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
: Uma Shankari T. [EMAIL PROTECTED]
AHTo: [EMAIL PROTECTED]
AHSent: Tuesday, February 19, 2002 10:50 AM
AHSubject: [PHP] Difference between two dates
AH
AH
AH
AH
AH Hello,
AH
AH How can i find out the difference between two dates.
AH
AH I am having the date like this
AH
AH $str=10-01-2001
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
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 having
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])
?
$time1 =
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:
RLThis will give you the difference between the two dates in seconds:
RL
RL$diff =
10 matches
Mail list logo