View Single Post
  #2  
Old 04-04-2010, 03:21 AM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
You're going to need to use a timeout, or something similar. Since seconds are your smallest unit, make the 'jail time' count in seconds; e.g., 1 hour in jail would be 3600 seconds. Store that somewhere, like a clientr. variable.

Then, format those seconds into the hh:mm:ss format. There are functions in the Code Gallery for that, I think. But it's pretty easy math:
hours = jailTimeinSeconds / 3600
minutes = (jailTimeinSeconds % 3600) / 60
seconds = (jailTimeinSeconds % 3600) % 60
After that, you're going to need to do some special formatting to put zeros in front of single-digit numbers. (As simple as checking if the number < 10.)

Then just display that however you want.
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote