Re: [PHP] Subtracting dates w/o database interaction (MySQL)

2005-09-23 Thread Stephen Leaf
$date = mysql date field 2005-09-23 for example $difference =ceil((strtotime($date) - time()) / 86400); strtotime is far nicer than mktime when you already have a date field ready. On Friday 23 September 2005 03:10 pm, Philip Thompson wrote: > On Sep 23, 2005, at 11:16 AM, Chris W. Parker wrote:

Re: [PHP] Subtracting dates w/o database interaction (MySQL)

2005-09-23 Thread Philip Thompson
On Sep 23, 2005, at 11:16 AM, Chris W. Parker wrote: Philip Thompson on Friday, September 23, 2005 9:12 AM said: I'm needing to find the number of days between two dates without using an database functions (DATE_SUB, etc)... only PHP. Is there an easy way to acco

Re: [PHP] Subtracting dates w/o database interaction (MySQL)

2005-09-23 Thread Gustav Wiberg
- Original Message - From: "Philip Thompson" <[EMAIL PROTECTED]> To: Sent: Friday, September 23, 2005 6:11 PM Subject: [PHP] Subtracting dates w/o database interaction (MySQL) Hey all. I'm needing to find the number of days between two dates without using a

RE: [PHP] Subtracting dates w/o database interaction (MySQL)

2005-09-23 Thread Chris W. Parker
Philip Thompson on Friday, September 23, 2005 9:12 AM said: > I'm needing to find the number of days between two dates without > using an database functions (DATE_SUB, etc)... only PHP. Is there an > easy way to accomplish this? I have searched the PHP site, but have

[PHP] Subtracting dates w/o database interaction (MySQL)

2005-09-23 Thread Philip Thompson
Hey all. I'm needing to find the number of days between two dates without using an database functions (DATE_SUB, etc)... only PHP. Is there an easy way to accomplish this? I have searched the PHP site, but have not been successful in finding anything that will assist me. Any help would be

Re: [PHP] subtracting dates...

2003-08-02 Thread John Ryan
yeah, thats the code i wrote myself (nearly). it gets the job done. thanks "Curt Zirzow" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > * Thus wrote John Ryan ([EMAIL PROTECTED]): > > Hi, > > > hello ryan, > > > In mySQL, I store dates as -MM-DD, a standard DATE type. It stores

Re: [PHP] subtracting dates...

2003-08-02 Thread Curt Zirzow
* Thus wrote John Ryan ([EMAIL PROTECTED]): > Hi, > hello ryan, > In mySQL, I store dates as -MM-DD, a standard DATE type. It stores users > date of births. I need to calculate in a PHP script, the users age from this > DOB. I get a PHP date in the same format as the mySQL and subtract, which

[PHP] subtracting dates...

2003-08-02 Thread John Ryan
Hi, In mySQL, I store dates as -MM-DD, a standard DATE type. It stores users date of births. I need to calculate in a PHP script, the users age from this DOB. I get a PHP date in the same format as the mySQL and subtract, which returns the year rounded off. ie, it doesnt matter if your birthda

RE: [PHP] Subtracting dates in php

2003-07-01 Thread Boaz Yahav
From: Mike Mannakee [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 01, 2003 7:22 AM To: [EMAIL PROTECTED] Subject: [PHP] Subtracting dates in php Anyone know of an easy way to add or subtract dates in php the way you can in mysql? Easier, that is, than coding the logic by hand? This seems l

Re: [PHP] Subtracting dates in php

2003-07-01 Thread David Otton
On Tue, 1 Jul 2003 01:21:54 -0400, you wrote: >Anyone know of an easy way to add or subtract dates in php the way you can >in mysql? Easier, that is, than coding the logic by hand? This seems like >a total pain. Convert to Unix timestamps, do regular maths, unconvert. -- PHP General Mailing

[PHP] Subtracting dates in php

2003-06-30 Thread Mike Mannakee
Anyone know of an easy way to add or subtract dates in php the way you can in mysql? Easier, that is, than coding the logic by hand? This seems like a total pain. Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] subtracting Dates

2001-05-01 Thread Gyozo Papp
> Hello, > For instance today is 05-01-2001 I would like to > determan the previous 7 days from that date. In VB > Date - 7 = 04-24-2001 I would like this to work for > any date using php. > Here is what I have so far... > $t = (date ("m-d-Y")); > echo $t; // output 05-01-2001 > echo ""; > $r =

[PHP] subtracting Dates

2001-05-01 Thread Mike Mike
Hello, I am trying to make a hit counter graph that will have 7 days to it. Monday thru Friday. I'm having problems getting the last 7 days. For instance today is 05-01-2001 I would like to determan the previous 7 days from that date. In VB Date - 7 = 04-24-2001 I would like this to work for an