Jump to content
  • 0

server time


caspa

Question


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

can i have a script where it would display a 12 hour based times and not 24 hour based time on the waitingroom?



like if the time is 1:00 PM ........ it displays 1:00 P.M and not 13:00 PM

Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  193
  • Reputation:   14
  • Joined:  12/02/11
  • Last Seen:  

prontera,x,y,z	script	AM/PM Time-based NPC	800,{

end;

OnInit:

do {

set .hours,gettime(3);

set .min,gettime(2);

set .sec,gettime(1);

if(.hours > 12) {

set .ampm$,"PM";

set .hours,.hours-12;

} else {

set .ampm$,"AM";

}

waitingroom "S.Time: "+.hours+" : "+.min+" : "+.sec+" "+.ampm$+".",0;

sleep 1000;

} while(true);

}

Not tested yet Edited by 2essy2killu
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  


prontera,167,196,3 script nRO Server Time 864,{

end;

OnInit:

while( 1 ){

delwaitingroom;

waitingroom " "+gettimestr( "%H:%M:%S %p",21 ),0;

sleep 1000;

}

end;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

prontera,167,196,3	script	nRO Server Time	864,{
end;
 
OnInit:
while( 1 ){
delwaitingroom;
waitingroom " "+gettimestr( "%H:%M:%S %p",21 ),0;
sleep 1000;
}
end;
}

this is a 24 hour based script...... this is the one i'm currently using..

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  400
  • Reputation:   5
  • Joined:  12/05/11
  • Last Seen:  

/shy Really?

 

I'm sorry.. My time now is 10AM in the morning. So, just simply gave you the script without testing it. /sry

 

Have you tried his script : http://rathena.org/board/topic/85549-server-time/#entry213138 ?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  


prontera,167,196,3 script nRO Server Time 864,{

end;

OnInit:

while( 1 ){

delwaitingroom;

waitingroom " "+gettimestr( "%r",21 ),0;

sleep 1000;

}

end;

}

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  194
  • Topics Per Day:  0.04
  • Content Count:  499
  • Reputation:   3
  • Joined:  03/11/12
  • Last Seen:  

prontera,167,196,3	script	nRO Server Time	864,{
end;
OnInit:
	while( 1 ){
		delwaitingroom;
		waitingroom " "+gettimestr( "%r",21 ),0;
		sleep 1000;
	}
	end;
}

when i use this one my map server crash....

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


prontera,167,196,3 script nRO Server Time 864,{

end;

OnInit:

while( 1 ){

delwaitingroom;

waitingroom " "+gettimestr( "%I:%M:%S %p",21 ),0;

sleep 1000;

}

end;

}

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

prontera,167,196,3	script	nRO Server Time	864,{
end;
OnInit:
	while( 1 ){
		delwaitingroom;
		waitingroom " "+gettimestr( "%I:%M:%S %p",21 ),0;
		sleep 1000;
	}
	end;
}

 

%r is the equivalent of %I:%M:%S %p.

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Yeah but it seems the emu doesn't support %r, but it's working with %I:%M:%S %p from my test

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Yeah but it seems the emu doesn't support %r, but it's working with %I:%M:%S %p from my test

 

Alright #noted.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...