error with 24 format with hours
#5

Not work ,it's 12 am o clock but show 00 o'clock.

Код HTML:
forward TimeUpdate();
public TimeUpdate()
{
    new Hour, Min, Sec, Day, Month, Year;
    new TimeString[256], TimeString2[256], TimeString3[256];
    gettime(Hour, Min, Sec);
    getdate(Year, Month, Day);
   	new year, month,day;
	getdate(year, month, day);
	new mtext[40];
	if(month == 1) { mtext = "ianuarie"; }
	else if(month == 2) { mtext = "februarie"; }
	else if(month == 3) { mtext = "martie"; }
	else if(month == 4) { mtext = "aprilie"; }
	else if(month == 5) { mtext = "mai"; }
	else if(month == 6) { mtext = "iunie"; }
	else if(month == 7) { mtext = "iulie"; }
	else if(month == 8) { mtext = "august"; }
	else if(month == 9) { mtext = "septembrie"; }
	else if(month == 10) { mtext = "octombrie"; }
	else if(month == 11) { mtext = "noiembrie"; }
	else if(month == 12) { mtext = "decembrie"; }
	if(Hour <= 9)
	{
		format(TimeString,25,"%02d:%02d",Hour, Min);
  	}
	else
	{
		format(TimeString,25,"%02d:%02d",Hour, Min);
  	}
   	if(Min <= 9)
   	{
    	format(TimeString,25,"%02d:%02d",Hour, Min);
     }
	else
	{
 		format(TimeString,25,"%02d:%02d",Hour, Min);
   	}
    if(Sec <= 9)
    {
    	format(TimeString2,25,":%02d", Sec);
    }
	else
	{
 		format(TimeString2,25,":%02d", Sec);
	}
    if(Day <= 9)
    {
    	format(TimeString3,25,"%02d %s", Day, mtext);
    }
	else
	{
 		format(TimeString3,25,"%02d %s", Day, mtext);
   	}
   	TextDrawSetString(HClock,TimeString);
    TextDrawShowForAll(HClock);
    TextDrawSetString(HClock2,TimeString2);
    TextDrawShowForAll(HClock2);
    TextDrawSetString(HClock3,TimeString3);
    TextDrawShowForAll(HClock3);
    return 1;
}
Reply


Messages In This Thread
error with 24 format with hours - by MrTea - 17.04.2017, 19:23
Re: error with 24 format with hours - by 1fret - 17.04.2017, 19:50
Re: error with 24 format with hours - by MrTea - 17.04.2017, 20:10
Re: error with 24 format with hours - by khRamin78 - 18.04.2017, 04:12
Re: error with 24 format with hours - by MrTea - 18.04.2017, 09:18
Re: error with 24 format with hours - by GangstaSunny. - 18.04.2017, 09:53
Re: error with 24 format with hours - by MrTea - 18.04.2017, 10:36
Re: error with 24 format with hours - by GangstaSunny. - 18.04.2017, 11:21
Re: error with 24 format with hours - by MrTea - 18.04.2017, 13:30
Re: error with 24 format with hours - by MrTea - 18.04.2017, 14:09

Forum Jump:


Users browsing this thread: 1 Guest(s)