Re: syntax for date math expressions
| From: | Erik Price | Date: | Wed, 03 Apr 2002 21:17:37 +0000 |
| Subject: | Re: syntax for date math expressions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-91409@lists.php.net to get a copy of this message | ||
On Wednesday, April 3, 2002, at 03:58 PM, Miguel Cruz wrote:
On Wed, 3 Apr 2002, Rick Emery wrote:I'd actually like to use MySQL's builtin date formats, but I like the timestamp that PHP uses (and I like what I can do with a timestamp in the date() function) so I have been using VARCHAR(20) to hold the date as a string. MySQL's TIMESTAMP is not the same thing as PHP's. Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.comConvert to date/time variable and perform arithmetic. Otherwise, if these dates are from mysql, let mysql do itEven 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.