Timimg in php

I want to write the script that allow user to playing the simple puzzle game but the amount of time. For example the game start at 10:30 and support to be finished 2 hours later i.e 12:30 after that time the score will not be calculate. Could anyone tell me how to implement such a thing. Thank you
P/s i already wrote the game i just need to do the calculating score system.
Who is Participating?
look through there.. figure out how to find time and :

startTime = ....;
endTime = startTime + 120;
do {
/* game code */
nowTime = ....;
} while (nowTime < endTime);
show_sourceConnect With a Mentor Commented:
Or use time() and sessions

$_SESSION["startSec"] = time();
/* game code */
if($_SESSION["startSec"] < (60*60*2) {

Instead af sessions, you could set a cookie

And with some Javascript you could show the  time there's left to play
All Courses

From novice to tech pro — start learning today.