Live data from Hacker News

Bttf is a command line datetime Swiss army knife

github.com

21–30 of 104 posts

Re: Bttf is a command line datetime Swiss army knife

#21
I'm the author of Bttf. I just wanted to share a really cool example of something that Bttf can do that I _think_ is kinda hard to do otherwise. (And also, I want to make an assertion about it and I hope this will lead to me being wrong and learning something new.)

The use case is: "I want to see a list of all files in a repository, sorted in ascending order of when it was most recently changed according to source control. I also want to highlight the time with color, make it be in local time and format it in my own bespoke way using strftime." Here's the full command (run from the root of https://github.com/BurntSushi/ripgrep):

    $ git ls-files |
        bttf tag exec git log -n1 --format='%aI' |
        bttf time in system |
        bttf time sort |
        bttf time fmt -f '%a %Y-%m-%d %H:%M:%S' |
        bttf untag -f '{tag}|t{data}'
    ...
    Thu 2025-10-30 13:30:14 crates/ignore/Cargo.toml
    Sat 2025-11-29 14:11:38 crates/core/flags/lowargs.rs
    Wed 2025-12-17 11:38:12 tests/misc.rs
    Wed 2025-12-17 11:38:12 tests/util.rs
    Thu 2026-02-12 20:39:46 crates/ignore/src/default_types.rs
    Fri 2026-02-20 16:06:29 crates/core/flags/config.rs
    Fri 2026-02-27 11:25:19 GUIDE.md
    Fri 2026-02-27 11:25:19 crates/core/flags/defs.rs
    Mon 2026-05-25 23:56:53 CONTRIBUTING.md
    Tue 2026-05-26 08:32:43 AI_POLICY.md
Or even ask for a specific time window:

    $ git ls-files |
        bttf tag exec git log -n1 --format='%aI' |
        bttf time in system |
        bttf time cmp ge 2026-01-01 |
        bttf time cmp lt 2026-04-01 |
        bttf time sort |
        bttf time fmt -f '%a %Y-%m-%d %H:%M:%S' |
        bttf untag -f '{tag}|t{data}'
    Thu 2026-02-12 20:39:46 crates/ignore/src/default_types.rs
    Fri 2026-02-20 16:06:29 crates/core/flags/config.rs
    Fri 2026-02-27 11:25:19 GUIDE.md
    Fri 2026-02-27 11:25:19 crates/core/flags/defs.rs
If you run this on a big repository, it will take quite a lot of time because `git log -n1` takes a long time. I think this is the fastest way to get the most recent commit time on a single file? (That's the assertion that I hope someone can correct me on!) In any case, `bttf tag exec` is using parallelism under the hood to make this even faster.

Re: Bttf is a command line datetime Swiss army knife

#22
post #5

I am a happy user of dateutils [0], but I will try out Biff and see which one is more ergonomic. [0]: https://www.fresse.org/dateutils/

Yes! dateutils is great! I have a comparison about it here: https://github.com/BurntSushi/biff/blob/master/COMPARISON.md...

The comparison with GNU date is also likely informative.

Re: Bttf is a command line datetime Swiss army knife

#23
post #2

No, Biff informs the system whether you want to be notified when mail arrives during the current terminal session.

Yeah the name collision is unfortunate, but probably fine. The name Biff was just too good to pass up. The name comes from the fact that Biff is a character in Back to the Future, and it rhymes with Jiff[1]. Jiff is the datetime library that Biff uses. "Make like a tree and get out of here!" https://www.youtube.com/shorts/9Jabplo2pZU [1]: https://github.com/BurntSushi/jiff

It was a great opportunity to name a unix tool "mcfly" or just "Marty" for time manipulation. Better luck next time, I guess.

Re: Bttf is a command line datetime Swiss army knife

#24
post #23

Earlier quoted context omitted.

Yeah the name collision is unfortunate, but probably fine. The name Biff was just too good to pass up. The name comes from the fact that Biff is a character in Back to the Future, and it rhymes with Jiff[1]. Jiff is the datetime library that Biff uses. "Make like a tree and get out of here!" https://www.youtube.com/shorts/9Jabplo2pZU [1]: https://github.com/BurntSushi/jiff

It was a great opportunity to name a unix tool "mcfly" or just "Marty" for time manipulation. Better luck next time, I guess.

That's... not terrible. Biff isn't exactly popular (yet?), so a name change isn't out of the question. Both of those names (and `biff`) are already taken on crates.io. Which is maybe not a huge problem. IDK. Naming is hard.

Re: Bttf is a command line datetime Swiss army knife

#25

Earlier quoted context omitted.

Yeah the name collision is unfortunate, but probably fine. The name Biff was just too good to pass up. The name comes from the fact that Biff is a character in Back to the Future, and it rhymes with Jiff[1]. Jiff is the datetime library that Biff uses. "Make like a tree and get out of here!" https://www.youtube.com/shorts/9Jabplo2pZU [1]: https://github.com/BurntSushi/jiff

> Yeah the name collision is unfortunate, but probably fine. The name Biff was just too good to pass up. So if I do an "apt install biff" on Debian (or Ubuntu) what will happen? * https://packages.debian.org/search?keywords=biff If I type in "biff" on a Debian CLI, what should I expect the behaviour of the program that is executed to be? Will it be something about mail or time?

I honestly don't know. Which is... Not Great.

Re: Bttf is a command line datetime Swiss army knife

#26

I'm the author of Bttf. I just wanted to share a really cool example of something that Bttf can do that I _think_ is kinda hard to do otherwise. (And also, I want to make an assertion about it and I hope this will lead to me being wrong and learning something new.) The use case is: "I want to see a list of all files in a repository, sorted in ascending order of when it was most recently changed according to source co…

Thank you for making cool stuff and sharing it with us.

Re: Bttf is a command line datetime Swiss army knife

#27
post #2

No, Biff informs the system whether you want to be notified when mail arrives during the current terminal session.

All short names, that is, pronounceable strings of 4 or maybe even 5 letters are already taken. Some of them taken many times over.

I think fewer people now care about mail notifications in a terminal session than about wrangling datetimes on the command line.

Re: Bttf is a command line datetime Swiss army knife

#28
post #27
post #2

No, Biff informs the system whether you want to be notified when mail arrives during the current terminal session.

All short names, that is, pronounceable strings of 4 or maybe even 5 letters are already taken. Some of them taken many times over. I think fewer people now care about mail notifications in a terminal session than about wrangling datetimes on the command line.

[deleted]

Re: Bttf is a command line datetime Swiss army knife

#29
post #23

Earlier quoted context omitted.

It was a great opportunity to name a unix tool "mcfly" or just "Marty" for time manipulation. Better luck next time, I guess.

That's... not terrible. Biff isn't exactly popular (yet?), so a name change isn't out of the question. Both of those names (and `biff`) are already taken on crates.io. Which is maybe not a huge problem. IDK. Naming is hard.

https://crates.io/search?q=bttf

// backronym bttf stands for biff time to format

Re: Bttf is a command line datetime Swiss army knife

#30

Earlier quoted context omitted.

That's... not terrible. Biff isn't exactly popular (yet?), so a name change isn't out of the question. Both of those names (and `biff`) are already taken on crates.io. Which is maybe not a huge problem. IDK. Naming is hard.

https://crates.io/search?q=bttf // backronym bttf stands for biff time to format

I like this
Post reply on HN