Re: ADDING DATES

From: Date: Mon, 14 Jan 2002 10:41:11 +0000
Subject: Re: ADDING DATES
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-15751@lists.php.net to get a copy of this message
Hear, hear! =dn > Yep, maybe it is, but when a post starts with " ... but i am getting lazy", > I get a bit peeved. The implication is "Do my work for me." > > It's different when the context is I want to do this ... tried this ... > results aren't right ... please help. > > Miles > > At 06:04 PM 1/13/2002 -0800, Daniel Barton wrote: > >Miles, > >Hmm... "RTFM!" .. > >That's a pretty unproductive post. > > > >Pedro, > >There are two PHP functions that will suffice. date() and mktime(). > > > >I've cut and pasted this from the PHP manual: > > > >$tomorrow = mktime (0,0,0,date("m") > >,date("d")+1,date("Y")); > >$lastmonth = mktime (0,0,0,date("m")-1,date("d"), > >date("Y")); > >$nextyear = mktime (0,0,0,date("m"), date("d"), > >date("Y")+1); > > > >That should do the trick. > > > >-db > > > >Miles Thompson wrote: > > > > > RTFM! > > > > > > At 12:17 AM 1/14/2002 +0000, Pedro M. S. Oliveira wrote: > > > > > > >Hi all, first of all i'm sorry to ask this but i am getting lazy and i bet > > > >you all can answer me in a couple of code lines. > > > >i want to add some days to the the result of the date php function. > > > >how can i had lets say 3 days? > > > >ex: > > > >(pseudo code) > > > > > > > ><? > > > >$date =date(yyyy,mm,dd); > > > >$date =date(yyyy,mm,dd) + 3days; > > > >echo $date; > > > >echo "thank you all"; > > > >?> > > > > > > > >Thanks > > > >Pedro > > > > > > > > > > > >-- > > > >PHP Database Mailing List (http://www.php.net/) > > > >To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > > > >For additional commands, e-mail: php-db-help@lists.php.net > > > >To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > -- > > > PHP Database Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > > > For additional commands, e-mail: php-db-help@lists.php.net > > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > >-- > >---------- > >Dan Barton > >Terrestrial Program Biologist > >Asst. Data Manager > >Point Reyes Bird Observatory > >http://www.prbo.org > >dbarton@prbo.org > >dbarton@grayflycatcher.org > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.db (#15751) next »