[thelist] Adding 15 mins to PHP time...

Tris beertastic at gmail.com
Wed Dec 13 10:05:29 CST 2006


MAny thaks to all..
I ended up doing:

	$_SESSION[timeStart] = date("H:i:s");
	$_SESSION[timeEnd] = date('H:i:s',strtotime('+15 minute'));

and just putting::

	if ($_SESSION[timeEnd] <= $_SESSION[timeStart]) {
		$pageDisplay = "TIMES UP!";
	}

on each page...

Hopefully it'll work.. right? ;-p
o rdo I have to convert it to a unix time stamp blah blah blah..

Tris...

On 13/12/06, Eduardo Kienetz <eduardok at gmail.com> wrote:
> On 12/13/06, Tris <beertastic at gmail.com> wrote:
> > I'm creating a timer for todays lucky client...
> > They wanna hit start and have a timer on screen across all pages..
> > No prob doing that in javascript, so I'm gonna create a session called
> > timer with the date value:
> > date("H:i:s"); Giving: 15:42:34 etc.. (the precise users start time)
> >
> > What I need to do is on each page, check the current server time, and
> > if it's 15 mis higher than my session, redirect the user to a thank
> > you page and destroythetimer session..
> >
> > soooo...
> >
> > How can I add 15 mins to a date function?
> > (I'm also gonna have to fee different times to the javasript ticker,
> > but that'll be easiy once I kno whow to knock off time from um, well,
> > time :-p  )
>
> $startDate = "01/08/2006 08:04:20";
> echo date("d/m/Y H:i:s", strtotime("+15 minutes",strtotime($startDate)));
> Will print: 08/01/2006 08:19:20
>
> --
> Eduardo  Bacchi Kienetz
> LPI Certified - Level 2
> http://www.noticiaslinux.com.br/eduardo/
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>



More information about the thelist mailing list