Hello,

Thanks for the reply.

1. Other utils do not require `-` to be specified, do they? For example, the manpage for sed says:

> if no input files are specified, then the standard input is read.

Why date requires it?

2. In any case, I think it should be documented to pass `-` to read from stdin

3. The command `stat --format "%Y" check.txt | date -f-` does not work. It returns:

> date: invalid date ‘1705140089’

It looks like the -f command requires human-readable date, and won't work with seconds since the epoch

4. On a related note, the man page I think should also document the use of `@` for seconds since the epoch.

It provides an example:

> Convert seconds since the Epoch (1970-01-01 UTC) to a date
>
> $ date --date='@2147483647'

But `@` per-se is not documented.

Thanks again and best regards,
Philips

On 13/01/2024 10.43, Marc Chantreux wrote:
hello,

On Sat, Jan 13, 2024 at 05:14:25AM +0100, Philip Rogers wrote:

Would it be possible to implement reading from stdin in date?
already exists:

        stat --format "%Y" check.txt | date -f-

regards
marc

Reply via email to