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
[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'
> 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
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
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
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
> 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
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
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
To: 'ROBERT MCPEAK'; [EMAIL PROTECTED]
Subject: RE: [PHP] syntax for date math expressions
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
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
What is the php syntax for adding or subtracting dates?
For example, I'd like to do something like this:
2002-04-03 - 2002-04-02 = 1
or
2002-04-03 - 2002-04-02 = -00-01
or
2002-04-03 + -00-01 = 2002-04-03
etc.
Can anybody help this newbie?
Thanks!
--
PHP General Mailing List
12 matches
Mail list logo