Z4Zy Posted May 31, 2018 Share Posted May 31, 2018 Hi There ! Below code draw a DX text with Real World Time. function time () local time = getRealTime() local hours = time.hour local minutes = time.minute dxDrawRectangle (112, 468, 134, 47, tocolor(0, 0, 0, 150)) dxDrawText (hours..":"..minutes, 146, 476, 304, 536, tocolor(255,255,255), 2) end addEventHandler ( "onClientRender", root, time ) This time is in digital clock [ ex :- 1.30 PM ==> 13:30 , 6.00 PM ==> 18:00 ] And how to convert it to analog clock ?? [ ex :- 13:30 ==> 1.30 PM , 18:00 ==> 6.00 PM ] Link to comment
AJXB Posted May 31, 2018 Share Posted May 31, 2018 You mean it's 12 hours based and you want it 24 hours based? Link to comment
WiBox Posted May 31, 2018 Share Posted May 31, 2018 (edited) He mean, if the Time in real world was 14:00 he want it to show as 2:00PM And same from 2:00PM he want it to show as 14:00 Edited May 31, 2018 by SSKE Link to comment
AJXB Posted May 31, 2018 Share Posted May 31, 2018 if (hour > 12) then hour = hour-12 end Isn't it this simple? From 00:00 to 12:00 that's morning, so it's AM, after 12:00 it's all PM Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now