Re: Date Subtraction

From: Date: Wed, 07 Nov 2001 20:45:49 +0000
Subject: Re: Date Subtraction
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-73793@lists.php.net to get a copy of this message
With MySQL you can do a select query and use UNIX_TIMESTAMP which will return a timestamp of the date within the MySQL table. If you call time() or time()+60*5 would equal the current time + 5 minutes, once you get the "future" date/time correct then just subtract it from the MySQL time, or vice versa whichever fits what you are doing. If this didnt answer your question fully, do not hesitate to email me. Thanks! Rick > From: Dan Tappin <dan@tappin.ca> > Date: Wed, 07 Nov 2001 13:37:53 -0700 > To: <php-general@lists.php.net> > Subject: [PHP] Date Subtraction > > I need to get a days, hours, minutes, seconds difference between two dates. > I have seen in the archives that MySQL is the way to go here. I took a shot > at the examples and they make sense. The problem is that all of these are > for a fixed date or the system date minus 1 day or 5 hours etc. I need the > difference between now and a future date i.e. a countdown type of result. > > Thanks, > > Dan > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#73793) next »