MCPcopy Create free account
hub / github.com/assaultcube/AC / timestring

Function timestring

source/src/tools.cpp:22–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20string _timestringbuffer = "";
21
22const char *timestring(time_t t, bool local, const char *fmt, char *buf)
23{
24#ifdef NO_POSIX_R
25 struct tm *timeinfo;
26 timeinfo = local ? localtime(&t) : gmtime (&t);
27#else
28 struct tm *timeinfo, b;
29 timeinfo = local ? localtime_r(&t, &b) : gmtime_r(&t, &b);
30#endif
31 strftime(buf, sizeof(string) - 1, fmt && *fmt ? fmt : "%Y%m%d_%H.%M.%S", timeinfo); // sortable time for filenames
32 return buf;
33}
34
35const char *asctimestr()
36{

Callers 2

asctimestrFunction · 0.70
formatdemofilenameFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected