Skip to content

fix(date): date -r does not return file modification time #1113

@chaliy

Description

@chaliy

Summary

date -r <file> should return the file's modification time, but in bashkit it returns an empty/current timestamp instead.

Reproduction

touch /tmp/test.txt
date -r /tmp/test.txt +"%B %d, %Y"
# Expected: file's modification date
# Actual: empty or current time

Context

Discovered while running bashblog via bashkit CLI. Bashblog uses date -r extensively to:

  • Read post timestamps: LC_ALL=C date -r "$i" +"$date_format_full"
  • Generate archive headers: date -r "$i" +"$date_allposts_header"
  • Format dates for RSS feed: date -r "$i" +"$date_format_full"

Without this, all timestamps in the generated blog are empty.

Expected behavior

date -r <file> +<format> should stat the file on the VFS and format its modification time.

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