Hacker News Viewer

Biff is a command line datetime Swiss army knife

by burntsushi on 5/28/2026, 2:58:44 AM

https://github.com/BurntSushi/biff

Comments

by: burntsushi

I&#x27;m the author of Biff. I just wanted to share a really cool example of something that Biff 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.)<p>The use case is: &quot;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.&quot; Here&#x27;s the full command (run from the root of <a href="https:&#x2F;&#x2F;github.com&#x2F;BurntSushi&#x2F;ripgrep" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;BurntSushi&#x2F;ripgrep</a>):<p><pre><code> $ git ls-files | biff tag exec git log -n1 --format=&#x27;%aI&#x27; | biff time in system | biff time sort | biff time fmt -f &#x27;%a %Y-%m-%d %H:%M:%S&#x27; | biff untag -f &#x27;{tag}|t{data}&#x27; ... Thu 2025-10-30 13:30:14 crates&#x2F;ignore&#x2F;Cargo.toml Sat 2025-11-29 14:11:38 crates&#x2F;core&#x2F;flags&#x2F;lowargs.rs Wed 2025-12-17 11:38:12 tests&#x2F;misc.rs Wed 2025-12-17 11:38:12 tests&#x2F;util.rs Thu 2026-02-12 20:39:46 crates&#x2F;ignore&#x2F;src&#x2F;default_types.rs Fri 2026-02-20 16:06:29 crates&#x2F;core&#x2F;flags&#x2F;config.rs Fri 2026-02-27 11:25:19 GUIDE.md Fri 2026-02-27 11:25:19 crates&#x2F;core&#x2F;flags&#x2F;defs.rs Mon 2026-05-25 23:56:53 CONTRIBUTING.md Tue 2026-05-26 08:32:43 AI_POLICY.md </code></pre> Or even ask for a specific time window:<p><pre><code> $ git ls-files | biff tag exec git log -n1 --format=&#x27;%aI&#x27; | biff time in system | biff time cmp ge 2026-01-01 | biff time cmp lt 2026-04-01 | biff time sort | biff time fmt -f &#x27;%a %Y-%m-%d %H:%M:%S&#x27; | biff untag -f &#x27;{tag}|t{data}&#x27; Thu 2026-02-12 20:39:46 crates&#x2F;ignore&#x2F;src&#x2F;default_types.rs Fri 2026-02-20 16:06:29 crates&#x2F;core&#x2F;flags&#x2F;config.rs Fri 2026-02-27 11:25:19 GUIDE.md Fri 2026-02-27 11:25:19 crates&#x2F;core&#x2F;flags&#x2F;defs.rs </code></pre> 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&#x27;s the assertion that I hope someone can correct me on!) In any case, `biff tag exec` is using parallelism under the hood to make this even faster.

5/28/2026, 10:58:20 AM


by: yzydserd

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

5/28/2026, 7:20:07 AM


by: e40

I remember when biff was what we ran in a CSH to be informed of new email. I don’t remember if this was a local UCB tool or if it was part of BSD.

5/28/2026, 10:01:38 AM


by: smartmic

I am a happy user of dateutils [0], but I will try out Biff and see which one is more ergonomic.<p>[0]: <a href="https:&#x2F;&#x2F;www.fresse.org&#x2F;dateutils&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.fresse.org&#x2F;dateutils&#x2F;</a>

5/28/2026, 7:48:27 AM


by: ramon156

Same dude that made jiff. Love that library, so I&#x27;m assuming biff is built on top of jiff.

5/28/2026, 9:26:40 AM


by: jibaoproxy

The thing Biff gets right that gnu `date` and most stdlib datetime APIs get wrong: it treats &quot;civil time&quot; and &quot;absolute instants&quot; as different types. You cannot answer &quot;what&#x27;s 30 days from 2024-03-08 in America&#x2F;New_York&quot; without picking a side — DST means that&#x27;s either 29d23h or 30d0h of elapsed time, and most APIs silently pick one without telling you.<p>Jiff (the underlying Rust crate) gets this from Temporal in TC39, which is the first time JS standards have led anything datetime-shaped. Hopefully the rest of the ecosystem catches up — Python&#x27;s `zoneinfo` only landed in 3.9 and `datetime.timezone` still has sharp edges.

5/28/2026, 9:25:27 AM


by: elcaro

% biff<p>2026 M05 28, Thu 17:27:46<p>Ahh, the month of M05

5/28/2026, 7:28:08 AM