Re: getting a date 25 years back

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Merlin wrote:
Hi there,

I am trying to create a date which is 25 years back from today. The purpose of this is to be able to query a mysql database "date" field for columns smaller than this date.

I tried this:
$years = 25;
$start_from = date("Y-m-d",strtotime("- ".$years." year"));

Somehow it always ads the years instead of subtracting.

Has anybody an idea on how to do that?

Thank you in advance for any help,

Merlin


http://us4.php.net/mktime

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john@xxxxxxxxxxxx

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux