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 an database functions (DAT

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

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

RE: [PHP] Subtracting dates in php

2003-07-01 Thread Boaz Yahav
Try : Difference between two dates (i.e. between today and a date in future). The program is based on php-timestamp, but in your browser you see the usual dates(i.e.: dd.mm.) http://examples.weberdev.com/get_example.php3?count=3240 Find the Difference between today's date and a future day. h

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

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 =