Re: Fw: [PHP] How do you get yesterday's date?
| From: | Folke Ashberg | Date: | Fri, 24 Nov 2000 22:47:46 +0000 |
| Subject: | Re: Fw: [PHP] How do you get yesterday's date? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27052@lists.php.net to get a copy of this message | ||
Hi!
time() returns the unix epoch time. The epoch time are seconds from
1.1.1970.
you can add the seconds for one year 60*60*24*365 and you will get the
same time one year later.
setcookie ("TestCookie", $value,time()+3600); /* expire in 1 hour */
or even
setcookie ("TestCookie", $value,time()+31536000); /* expire in 1 year */
OK?
regards
Folke
--
Folke Ashberg
Stage Internet Services GmbH
Technical Development
folke@fanstage.de
folke@fanstage.de | Tel: +49 89 454591-77 | Fax: +49 89 454591-71
Kreillerstr. 21 | 81673 Munich | Germany | www.fanstage.de
On Fri, 24 Nov 2000, Noah Spitzer-Williams wrote:
> Like for example if i were setting a cookie to expire a year from now, do i
> have to do time() * ...? or is there an easier way
>
> -----------------
> The DevBoard - http://www.thedevboard.com
> -----------------
> http://www.alladvantage.com/go.asp?refid=BIY971
- AllAdvantage
> ----- Original Message -----
> From: "Noah Spitzer-Williams" <noahsw@cyberdude.com>
> To: "Folke Ashberg" <folke@fanstage.de>
> Sent: Friday, November 24, 2000 5:05 PM
> Subject: Re: [PHP] How do you get yesterday's date?
>
>
> > How about a year from now? is there a simple function for that?
> >
> > thanks!
> >
> > -----------------
> > The DevBoard - http://www.thedevboard.com
> > -----------------
> > http://www.alladvantage.com/go.asp?refid=BIY971
- AllAdvantage
> > ----- Original Message -----
> > From: "Folke Ashberg" <folke@fanstage.de>
> > Newsgroups: php.general
> > Sent: Friday, November 24, 2000 4:41 PM
> > Subject: Re: [PHP] How do you get yesterday's date?
> >
> >
> > > Use this:
> > >
> > > $yesterday_was=date("m/d/Y",time()-(60*60*24));
> > >
> > > regards
> > > Folke
> > >
> > > --
> > > Folke Ashberg
> > >
> > > Stage Internet Services GmbH
> > > Technical Development
> > > folke@fanstage.de
> > >
> > > folke@fanstage.de | Tel: +49 89 454591-77 | Fax: +49 89 454591-71
> > > Kreillerstr. 21 | 81673 Munich | Germany | www.fanstage.de
> > >
> > > On Fri, 24 Nov 2000, Noah Spitzer-Williams wrote:
> > >
> > > > in the form of: m/d/y please
> > > >
> > > > thanks! - Noah
> > > >
> > > > --
> > > >
> > > > -----------------
> > > > The DevBoard - http://www.thedevboard.com
> > > > -----------------
> > > > http://www.alladvantage.com/go.asp?refid=BIY971
- AllAdvantage
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > > For additional commands, e-mail: php-general-help@lists.php.net
> > > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> > >
> >
>