c++ - Converting system time int to formatted time string? -


i writing tool game , reading it's memory retrieve system time of messages sent game's chat. time in format of integer containing current system time 1429959524, example. how convert value formatted time string hours:minutes:seconds? can't figure out simple way this.

with <ctime> header can time formatted nicely in string using strftime

time_t rawtime; struct tm * timeinfo; char buffer[10]; time (&rawtime); timeinfo = localtime(&rawtime); strftime(buffer,10,"%i:%m:%s",timeinfo); std::string str(buffer); 

orifinally explained @ current date , time string


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -