If you want a timer to keep track of how long even while the player is offline you'll simply need to compare timevar2's.
When you jail the player, save a clientr of the current timevar2(on serverside) and time to stay jailed. For example: clientr.jailtime = {timevar2,days*24+hours*60+minutes*60}; Days, hours and minutes are simply representing real time you want them to be jailed.
Then every time they log in(or in the jail level, in a loop) do something like:
PHP Code:
if (timevar2 > clientr.jailtime[0] + clientr.jailtime[1]) {
// JAIL TIME OVER!
}
Alternatively you can have a DBNPC that handles all jailings.
Not only would doing this clientside yield undesired results, it would also be extremely insecure. I wouldn't trust the clientside to handle any of it, if it's meant for a jailing system.