What you always need to remember is that anything that happens on the client is exploitable. If you rely on Javascript to update the time counter then you are also giving a lot of trust to the users, in that they won't mess around with it.
The best thing to do is handling the timer with JS for graphical purposes and let the server check the actual time.
There are several ways to do that, one that comes to mind is:
The student starts the quiz, you will dynamically generate the JS code by using an echo statement, either directly e.g.:
echo "<script type='text/javascript'>var maxtime=".$maxtime."; ... </script>";
or (better) as the other answer says generate an hidden field that you can then read from JS.
The PHP code will also store the max finishing time (i.e. current time + 15 min or whatever the allotted time is) in a session variable.
You will have a JS counter that goes down to 0. When it reaches 0 it will automatically submit the page, or ask the user to do so etc.
When submitting the answers (either because the time ran out OR because the user finished in time and submitted the answers himself) the PHP will check that the current time is not greater than the max time stored in the session var.
This will allow you to check that the user did not cheat.
This is not the only option, you could, for instance, save the starting time (or the max finishing time) in a DB, it really depends how you are coding the page.