error with 24 format with hours
#1

Hello, my server didn't use 24 hourse format, for example if it is 22 pm o clock , server show me the right time but show like 10 am o clock not 22.
http://imgur.com/a/wAb3A --it's 22 pm o clock when i take photo.
Reply
#2

Quote:
Originally Posted by MrTea
Посмотреть сообщение
Hello, my server didn't use 24 hourse format, for example if it is 22 pm o clock , server show me the right time but show like 10 am o clock not 22.
http://imgur.com/a/wAb3A --it's 22 pm o clock when i take photo.
You cant just show a picture and expect us to give you a fix for your situation, you have to show us some coding.
Reply
#3

Quote:
Originally Posted by 1fret
Посмотреть сообщение
You cant just show a picture and expect us to give you a fix for your situation, you have to show us some coding.
I really didn't know were to look...
All i know i have this public and there are 3 textdraws
Код:
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,"0%d:%d",Hour, Min);
  	}
	else
	{
		format(TimeString,25,"%d:%d",Hour, Min);
  	}
   	if(Min <= 9)
   	{
    	format(TimeString,25,"%d:0%d",Hour, Min);
     }
	else
	{
 		format(TimeString,25,"%d:%d",Hour, Min);
   	}
    if(Sec <= 9)
    {
    	format(TimeString2,25,":0%d", Sec);
    }
	else
	{
 		format(TimeString2,25,":%d", Sec);
	}
    if(Day <= 9)
    {
    	format(TimeString3,25,"0%d %s", Day, mtext);
    }
	else
	{
 		format(TimeString3,25,"%d %s", Day, mtext);
   	}
   	TextDrawSetString(HClock,TimeString);
    TextDrawShowForAll(HClock);
    TextDrawSetString(HClock2,TimeString2);
    TextDrawShowForAll(HClock2);
    TextDrawSetString(HClock3,TimeString3);
    TextDrawShowForAll(HClock3);
    return 1;
}
Reply
#4

Quote:
Originally Posted by MrTea
Посмотреть сообщение
I really didn't know were to look...
All i know i have this public and there are 3 textdraws
Код:
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,"0%d:%d",Hour, Min);
  	}
	else
	{
		format(TimeString,25,"%d:%d",Hour, Min);
  	}
   	if(Min <= 9)
   	{
    	format(TimeString,25,"%d:0%d",Hour, Min);
     }
	else
	{
 		format(TimeString,25,"%d:%d",Hour, Min);
   	}
    if(Sec <= 9)
    {
    	format(TimeString2,25,":0%d", Sec);
    }
	else
	{
 		format(TimeString2,25,":%d", Sec);
	}
    if(Day <= 9)
    {
    	format(TimeString3,25,"0%d %s", Day, mtext);
    }
	else
	{
 		format(TimeString3,25,"%d %s", Day, mtext);
   	}
   	TextDrawSetString(HClock,TimeString);
    TextDrawShowForAll(HClock);
    TextDrawSetString(HClock2,TimeString2);
    TextDrawShowForAll(HClock2);
    TextDrawSetString(HClock3,TimeString3);
    TextDrawShowForAll(HClock3);
    return 1;
}
if you use %02d it will fixed i think

read here !
Reply
#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
#6

Set your server (where your samp server is on) to the timezone.
Reply
#7

Quote:
Originally Posted by GangstaSunny.
Посмотреть сообщение
Set your server (where your samp server is on) to the timezone.
My server is on from PC
Reply
#8

hm thats not pretty cool.
but u can set your pc time to 24 format and it will be good.
Reply
#9

I SET MY PC BUT DIDN'T WORK
Reply
#10

Quote:
Originally Posted by GangstaSunny.
Посмотреть сообщение
hm thats not pretty cool.
but u can set your pc time to 24 format and it will be good.
Solved ,Thanks!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)