RE: [PHP] syntax for date math expressions

From: Date: Wed, 03 Apr 2002 20:58:15 +0000
Subject: RE: [PHP] syntax for date math expressions
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-91406@lists.php.net to get a copy of this message
On Wed, 3 Apr 2002, Rick Emery wrote: > Convert to date/time variable and perform arithmetic. > Otherwise, if these dates are from mysql, let mysql do it Even if you don't happen to be getting the date out of MySQL, it can occasionally be easier to let MySQL do your date math since it has some nice functions for it (DATE_ADD, DATE_SUB, etc.). These things are hard to do quickly in PHP since you have to account for leap years. You can send MySQL (or really any SQL database) a select with hardcoded inputs rather than pulling from tables. miguel

« previous php.general (#91406) next »