MCPcopy Create free account
hub / github.com/coreutils/coreutils / time_string

Function time_string

src/pinky.c:182–195  ·  view source on GitHub ↗

Return a time string. */

Source from the content-addressed store, hash-verified

180
181/* Return a time string. */
182static char const *
183time_string (STRUCT_UTMP const *utmp_ent)
184{
185 static char buf[INT_STRLEN_BOUND (intmax_t) + sizeof "-%m-%d %H:%M"];
186 struct tm *tmp = localtime (&utmp_ent->ut_ts.tv_sec);
187
188 if (tmp)
189 {
190 strftime (buf, sizeof buf, time_format, tmp);
191 return buf;
192 }
193 else
194 return timetostr (utmp_ent->ut_ts.tv_sec, buf);
195}
196
197/* Display a line of information about UTMP_ENT. */
198

Callers 1

print_entryFunction · 0.70

Calls 1

timetostrFunction · 0.85

Tested by

no test coverage detected