Warning: include(/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php): failed to open stream: No such file or directory in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Warning: include(): Failed opening '/var/www/html/forum/Sources/../../../includes/depot_files/OFPEC_get_header_image.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 146

Notice: Undefined index: OFPEC in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152

Notice: Trying to access array offset on value of type null in /var/www/html/forum/Sources/Load.php(2272) : eval()'d code on line 152
    Home   Help Login Register  

Author Topic: Timer script - Keeping minutes/seconds format  (Read 1545 times)

0 Members and 1 Guest are viewing this topic.

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Timer script - Keeping minutes/seconds format
« on: 24 May 2007, 18:00:43 »
Hey

I have a basic timer script that loops through 60 seconds, then adds a minute and starts over again. However when I display the seconds and minutes, the result is like '0:1' instead of '0:01'

I understand that this is because of the variable format (being a number) and it would need to be a string to keep the two zero's.. however if it's a string I can not treat it like a number and simply add to it.

How would I keep the 2 digit seconds number?

Thanks.

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Timer script - Keeping minutes/seconds format
« Reply #1 on: 24 May 2007, 18:09:55 »
display two numeric variables next to each other, x:yz. if z>9, y = y + 1; z=0. repeat.