HN
Today

Biff is a command line datetime Swiss army knife

BurntSushi, the creator of ripgrep, introduces biff, a new command-line utility designed for advanced datetime manipulation. This Rust-based tool, built on his jiff library, offers powerful parsing, formatting, and arithmetic capabilities that aim to be more ergonomic than traditional date commands. Hacker News applauds the developer's continued contribution to essential CLI tools, while also engaging in a lively discussion about the tool's name colliding with a classic Unix utility.

38
Score
24
Comments
#16
Highest Rank
8h
on Front Page
First Seen
May 28, 8:00 AM
Last Seen
May 28, 3:00 PM
Rank Over Time
1818201620202425

The Lowdown

Biff is a command-line interface (CLI) tool for comprehensive datetime handling, including arithmetic, parsing, and formatting. Developed by BurntSushi, known for ripgrep, it leverages the jiff Rust library and ICU4X for robust localization.

  • Versatile Operations: Perform complex datetime calculations, such as adding or subtracting durations, rounding times, and converting between time zones.
  • Flexible Formatting: Supports custom strftime-like format strings and standard RFC formats, making it adaptable for various output needs.
  • Sequential Date Generation: Generate sequences of dates based on specified intervals, weekdays, or until certain conditions are met.
  • Data Integration: Features a unique biff tag command to identify and process datetimes embedded within arbitrary data streams, allowing for integration with other command-line tools.
  • Modern Foundation: Built in Rust, offering precompiled binaries for multiple platforms and easy installation via cargo for Rust developers.
  • Not a date Replacement: Explicitly states it's not a drop-in replacement for the POSIX date command but rather an alternative for more complex or ergonomic datetime tasks.

Biff aims to provide a more intuitive and powerful interface for datetime operations on the command line, especially for use cases that prove cumbersome with standard utilities.

The Gossip

Biff's Benevolent Builder

Many commenters expressed appreciation for BurntSushi's work, recognizing him from other highly-regarded projects like `ripgrep` and the `jiff` library (which Biff uses). The author actively engaged in the comments, providing a detailed example of a complex `git` and `biff` pipeline, showcasing Biff's advanced capabilities for tasks like sorting files by commit date, which garnered positive attention.

Name Game Nuisance

The most significant discussion point revolved around the choice of the name "Biff." Several users immediately pointed out the collision with the old Unix `biff` command, which historically notified users of new email. While the author explained the name choice (a Back to the Future character and rhyming with `jiff`), he acknowledged the unfortunate collision, leading to a humorous debate on whether to change the name and how installation might conflict.

Date Debates and Alternatives

Commenters compared Biff to existing datetime utilities like GNU `date` and `dateutils`. While some were happy with their current tools, others were keen to try Biff for its promised ergonomics and advanced features. The author provided a comparison document, highlighting Biff's strengths where `date` falls short, particularly for complex date arithmetic and sequence generation.