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

Function show_date_helper

src/date.c:380–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378}
379
380static bool
381show_date_helper (char const *format, bool use_c_locale,
382 struct timespec when, timezone_t tz)
383{
384 if (parse_datetime_flags & PARSE_DATETIME_DEBUG)
385 error (0, 0, _("output format: %s"), quote (format));
386
387 bool ok;
388 if (use_c_locale)
389 {
390 char *old_locale_category = set_LC_TIME ("C");
391 ok = show_date (format, when, tz);
392 char *new_locale_category = set_LC_TIME (old_locale_category);
393 free (new_locale_category);
394 free (old_locale_category);
395 }
396 else
397 ok = show_date (format, when, tz);
398
399 putchar ('\n');
400 return ok;
401}
402
403/* Parse each line in INPUT_FILENAME as with --date and display each
404 resulting time and date. If the file cannot be opened, tell why

Callers 2

batch_convertFunction · 0.85
mainFunction · 0.85

Calls 2

set_LC_TIMEFunction · 0.85
show_dateFunction · 0.85

Tested by

no test coverage detected