Re: date range assistance needed

From: Date: Mon, 03 Mar 2003 23:50:07 +0000
Subject: Re: date range assistance needed
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-137989@lists.php.net to get a copy of this message
I believe PHP and MySQL use two different definitions of the start of a time stamp. One uses 1974 the other 1900 (I don't know exactly). If you echo strtotime($attributes[startdate]) , UNIX_TIMESTAMP (datestamp) Also, in your query you are looking for all headlines that have strtotime($attributes[startdate]) == UNIX_TIMESTAMP (datestamp). you have two strtotime($attributes[startdate]) but not an 'end date ' "Charles Kline" <ckline@ydim.com> wrote in message news:DE55CF6C-4DCE-11D7-B5B5-000393CDCA6A@ydim.com... > Here is my current query: > > $qAnnouncement = > 'SELECT id,headline > FROM tbl_funding > WHERE 1 > AND ((UNIX_TIMESTAMP (datestamp) >= ' . > strtotime($attributes[startdate]) . ') AND (UNIX_TIMESTAMP (datestamp) > <= ' . strtotime($attributes[startdate]) . ')) LIMIT 0, 30'; > > Where datestamp is set in MySQL with a timestamp(14) and > $attributes[startdate] and $attributes[enddate] are in the format > mm/dd/yyyy > > My query does not return any results. I know there must be something > wrong, can anyone point it out? > > Thanks, > Charles >

« previous php.general (#137989) next »