Re: getting a date 25 years back

From: Date: Tue, 14 Dec 2004 21:59:13 +0000
Subject: Re: getting a date 25 years back
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-204347@lists.php.net to get a copy of this message
On Wednesday 15 December 2004 03:21, Merlin wrote: > 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. Try: strtotime("$years years ago"); -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* printk ("%s: This looks like a LART board to me. ",module_name); linux-2.6.6/drivers/mtd/devices/lart.c */

« previous php.general (#204347) next »