Time Format
Hello
I'm using get_time_length() to display a time remaining hud message. Code:
But it gets formated like this: https://i.imgur.com/YogpW0w.png Is there anyway to use the HH:MM:SS format? EDIT: Fixed it by borrowing the code from another plugin. Code:
|
Re: Time Format
Try format_time() from amxmodx.inc.
|
Re: Time Format
Quote:
Sadly, format_time() accepts a unix timestamp as a parameter, while I'm using seconds remaning in g_iRoundTime. |
Re: Time Format
g_iRoundTime += g_Current_timestamp.......
|
Re: Time Format
Quote:
Quote:
Now, if you subtract the timezone offset, it works the way I was suggesting. However, subtracting the timezone offset will only work if you are west of the GMT. If you are east of the GMT you'd need to also add 24 hours. The only other obstacle is accounting for daylights savings which actually shifts your timezone offset. So, this works for me: PHP Code:
PHP Code:
|
All times are GMT -4. The time now is 11:48. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.