Help with textdraw watch
#3

Quote:
Originally Posted by Vince
View Post
Okay, first of all don't use this noobish method of adding leading zeros, use %02d instead.

PHP Code:
format(stringsizeof(string), "%02d:%02d:%02d"hoursminutesseconds); 
If "your host" is off standard time by more than 3 minutes then you should ask "your host" to use an NTP server. The best solution would simply be to change the time on the server but if you can't do that then you can add however many hours you want and perform a mod 24. It would then become:

PHP Code:
format(stringsizeof(string), "%02d:%02d:%02d", (hours 1) % 24minutesseconds); 
So if hour was 23 and you added 1 then the hour would become (23 + 1) % 24 = 0.
Okay, you added just +1 hour, but can you add 3 minutes and 15 seconds too and will there be a problem in the date?
Reply


Messages In This Thread
Help with textdraw watch - by Kraeror - 21.07.2017, 12:01
Re: Help with textdraw watch - by Vince - 21.07.2017, 13:00
Re: Help with textdraw watch - by Kraeror - 21.07.2017, 13:02
Re: Help with textdraw watch - by Kraeror - 21.07.2017, 15:46
Re: Help with textdraw watch - by Vince - 21.07.2017, 15:49
Re: Help with textdraw watch - by Kraeror - 21.07.2017, 20:01

Forum Jump:


Users browsing this thread: 1 Guest(s)