MCPcopy Create free account
hub / github.com/ElementsProject/lightning / json_add_timeiso

Function json_add_timeiso

common/json_stream.c:354–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352}
353
354void json_add_timeiso(struct json_stream *result,
355 const char *fieldname,
356 struct timeabs *time)
357{
358 char iso8601_msec_fmt[sizeof("YYYY-mm-ddTHH:MM:SS.%03dZ")];
359 char iso8601_s[sizeof("YYYY-mm-ddTHH:MM:SS.nnnZ")];
360
361 strftime(iso8601_msec_fmt, sizeof(iso8601_msec_fmt),
362 "%FT%T.%%03dZ", gmtime(&time->ts.tv_sec));
363 snprintf(iso8601_s, sizeof(iso8601_s),
364 iso8601_msec_fmt, (int) time->ts.tv_nsec / 1000000);
365
366 json_add_string(result, fieldname, iso8601_s);
367}
368
369
370void json_add_tok(struct json_stream *result, const char *fieldname,

Callers

nothing calls this directly

Calls 1

json_add_stringFunction · 0.70

Tested by

no test coverage detected