| 378 | } |
| 379 | |
| 380 | static bool |
| 381 | show_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 |
no test coverage detected