Re: date math question

From: Date: Fri, 28 Mar 2003 05:57:51 +0000
Subject: Re: date math question
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-141376@lists.php.net to get a copy of this message
sorry typo error should be: date('Y') Foong "Foong" <cheefoong@chilipadi.com> wrote in message news:20030328055614.75749.qmail@pb1.pair.com... > hi, > > $start = mktime ( 0, 0, 0, 1, 1, date['Y']); // first day of this year > $end = mktime ( 0, 0, 0, 12, 31, date['Y']); // last day of this year > > then select all record where timestamp >= $start and timestamp <= $end > > should do the job > Hope this helps > > Foong > > > > > "Charles Kline" <ckline@rightcode.net> wrote in message > news:DC64CAD4-60E0-11D7-A56B-000393CDCA6A@rightcode.net... > > Okay cool. > > > > This leads me to another question. If I have stored the date as an > > epoch then is there a way using PHP and MySQL to say find all the > > records that have been added this YEAR (not last 365 days)? > > > > Thanks > > Charles > > > > > > On Friday, March 28, 2003, at 12:31 AM, Leo Spalteholz wrote: > > > > > On March 27, 2003 09:15 pm, Charles Kline wrote: > > >> I am storing my dates as unix timestamp (epoch). Am I right in > > >> assuming that if I need to add or subtract days from this it is > > >> done in seconds? > > > > > > yes > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > >

« previous php.general (#141376) next »