RE: [PHP] syntax for date math expressions

2002-04-03 Thread Rick Emery
Convert to date/time variable and perform arithmetic. Otherwise, if these dates are from mysql, let mysql do it -Original Message- From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 11:12 AM To: [EMAIL PROTECTED] Subject: [PHP] syntax for date math expressions

RE: [PHP] syntax for date math expressions

2002-04-03 Thread Vail, Warren
diff("2002-04-03","2002-04-02") as difference from realtable Warren Vail Tools, Metrics & Quality Processes (415) 667-7814 Pager (877) 774-9891 215 Fremont 02-658 -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Wednesday, April 03, 2002 11:02 AM

RE: [PHP] syntax for date math expressions

2002-04-03 Thread Miguel Cruz
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 ni

Re: [PHP] syntax for date math expressions

2002-04-03 Thread Erik Price
On Wednesday, April 3, 2002, at 03:58 PM, Miguel Cruz wrote: > 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 > o

Re: [PHP] syntax for date math expressions

2002-04-03 Thread Rasmus Lerdorf
> 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. But you can si

Re: [PHP] syntax for date math expressions

2002-04-03 Thread Miguel Cruz
On Wed, 3 Apr 2002, Erik Price wrote: > On Wednesday, April 3, 2002, at 03:58 PM, Miguel Cruz wrote: >> 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

Re: [PHP] syntax for date math expressions

2002-04-03 Thread Erik Price
On Wednesday, April 3, 2002, at 04:14 PM, Rasmus Lerdorf wrote: > But you can simply call MySQL's UNIX_TIMESTAMP() function on the mysql > field when you select it if you want it into unix timestamp format. For SELECTs, this is fine, but what happens when I want to insert a new date? I trans

Re: [PHP] syntax for date math expressions

2002-04-03 Thread Rasmus Lerdorf
date() On Wed, 3 Apr 2002, Erik Price wrote: > > On Wednesday, April 3, 2002, at 04:14 PM, Rasmus Lerdorf wrote: > > > But you can simply call MySQL's UNIX_TIMESTAMP() function on the mysql > > field when you select it if you want it into unix timestamp format. > > For SELECTs, this is fine, bu

RE: [PHP] syntax for date math expressions

2002-04-03 Thread Maxim Maletsky
> as a string. MySQL's TIMESTAMP is not the same thing as PHP's. Let me be the devil's layer here, Erik. In order to achieve the best portability and to gain the best performance you'd better use mySQL date field types to store the dates. If you need the PHP timestamps you can simply use anoth

RE: [PHP] syntax for date math expressions

2002-04-03 Thread Maxim Maletsky
[EMAIL PROTECTED]] > Sent: Wednesday, April 03, 2002 11:27 PM > To: Rasmus Lerdorf > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] syntax for date math expressions > > > On Wednesday, April 3, 2002, at 04:14 PM, Rasmus Lerdorf wrote: > > > But you can simply call MySQL'

RE: [PHP] syntax for date math expressions

2002-04-03 Thread Maxim Maletsky
Message- > From: Erik Price [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 03, 2002 11:27 PM > To: Rasmus Lerdorf > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] syntax for date math expressions > > > On Wednesday, April 3, 2002, at 04:14 PM, Rasmus Lerdorf wrote