Skip to content

fix(date): date --date= flag returns empty output #1156

@chaliy

Description

@chaliy

Summary

`date +FORMAT --date=STRING` returns empty output instead of parsing the given date string.

Reproduction

date +"%B %d, %Y" --date="Mon, 06 Apr 2026 12:00:00 +0000"
# Expected: April 06, 2026
# Actual: (empty string)

Context

Discovered while running bashblog via bashkit CLI. Bashblog uses `--date=` in `create_html_page` to format timestamps stored in blog posts:

echo "<!-- $date_inpost: #$(LC_ALL=$date_locale date +"$date_format_timestamp" --date="$timestamp")# -->"
echo -n "<div class=\"subtitle\">$(LC_ALL=$date_locale date +"$date_format" --date="$timestamp")"

Without this, all post timestamps and subtitle dates render as empty, producing `` and empty `

` elements.

Expected behavior

`date --date=STRING +FORMAT` should parse the date string and format it according to the format specifier. Should support at minimum RFC 2822 date strings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions