02.03.2018, 15:18
Here is the script. Updating time and date - every second. Tell me, is there a load on the server due to this timer? And is there an easier solution for setting the clock / date on the server?
And another question, tell me how to change the time zone on the server? SetWorldTime does not help ...
And another question, tell me how to change the time zone on the server? SetWorldTime does not help ...
PHP код:
SetTimer("time", 1000, true);
forward time();
public time()
{
new string[256], year, month, day, hours, minutes, seconds;
getdate(year, month, day), gettime(hours, minutes, seconds);
format(string, sizeof string, "%d/%s%d/%s%d", day, ((month < 10) ? ("0") : ("")), month, (year < 10) ? ("0") : (""), year);
TextDrawSetString(Date, string);
format(string, sizeof string, "%s%d:%s%d:%s%d", (hours < 10) ? ("0") : (""), hours, (minutes < 10) ? ("0") : (""), minutes, (seconds < 10) ? ("0") : (""), seconds);
TextDrawSetString(Time, string);
}