Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Real Time on the HUD
Re: Real Time on the HUD [message #419658 is a reply to message #419247] Thu, 11 February 2010 00:40 Go to previous messageGo to previous message
Tunaman
Messages: 1190
Registered: January 2005
Karma:
General (1 Star)
time_t rawtime;
struct tm * timeinfo;
char f_time[9];
  
time(&rawtime);
timeinfo = localtime(&rawtime);
strftime(f_time,9,"%I:%M:%S",timeinfo);


This is some code that does what you want to do I think..
f_time is a string that contains your string formatted like "12:20:25" where 12 is the hour, 20 is the minute, 25 is the second, yeah. For more info about formatting with stftime go to: http://www.cplusplus.com/reference/clibrary/ctime/strftime/.


http://img694.imageshack.us/img694/9055/tunamanlmao.png

[Updated on: Thu, 11 February 2010 00:45]

Report message to a moderator

 
Read Message icon1.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Skin Help,
Next Topic: Editor Help!
Goto Forum:
  


Current Time: Fri Dec 13 22:04:45 MST 2024

Total time taken to generate the page: 0.01486 seconds