Re: [PHP] date calculations
Yow Sven, > I need to calculate the Time ( days hour minutes between 2 times ) > I have something but I have an error margine of 10 % and that is to high > > Time one 2002/02/24 10:23:43 > Time two 2002/02/02 12:43:12 > > this need to give me the correct time in days hours and minutes between the > 2 dates The broad answer would be to convert the values to (UNIX epoch) timestamps, do the calculation, and then convert back to your preferred presentation format. Where do the dates come from - a database? Are they ISO format dates? (in which case the separator should be - not /) It can be done! =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] date calculations
Yow I need to calculate the Time ( days hour minutes between 2 times ) I have something but I have an error margine of 10 % and that is to high Time one 2002/02/24 10:23:43 Time two 2002/02/02 12:43:12 this need to give me the correct time in days hours and minutes between the 2 dates
Re: [PHP] Date calculations
Greets, Edward - Original Message - From: "Sven Jacobs" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 21, 2002 4:56 PM Subject: [PHP] Date calculations > Hey > > I need to calculate the amount of days between 2 point > point 1 is now the second point is in the past > the format I have is in 2002-02-25 10:02:23 ( that is the format i have in > my db ) > now if I have today 2002-02-25 10:02:04 and the other day is 2002-02-24 > 09:02:04 > That means that the delta in days is 1 day ( the hours do not mather ) > > Somebody an idea ? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date calculations
look at the mysql docs at www.mysql.com/doc/ there are some functions about times. it is easy to work with time intervals. Best regards, Andrey Hristov - Original Message - From: "Sven Jacobs" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 21, 2002 5:56 PM Subject: [PHP] Date calculations > Hey > > I need to calculate the amount of days between 2 point > point 1 is now the second point is in the past > the format I have is in 2002-02-25 10:02:23 ( that is the format i have in > my db ) > now if I have today 2002-02-25 10:02:04 and the other day is 2002-02-24 > 09:02:04 > That means that the delta in days is 1 day ( the hours do not mather ) > > Somebody an idea ? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Date calculations
Hey I need to calculate the amount of days between 2 point point 1 is now the second point is in the past the format I have is in 2002-02-25 10:02:23 ( that is the format i have in my db ) now if I have today 2002-02-25 10:02:04 and the other day is 2002-02-24 09:02:04 That means that the delta in days is 1 day ( the hours do not mather ) Somebody an idea ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php