• Hacker News
  • new|
  • comments|
  • show|
  • ask|
  • jobs|
  • sherr 1 hours

    Respect for programming this. I did some date/time calculations a few years ago using Perl and it was full of corner cases and trouble. Did I enjoy it? I enjoyed seeing it work. Hopefully with the right answers! This tool looks great.

  • jibaoproxy 7 hours

    The thing Biff gets right that gnu `date` and most stdlib datetime APIs get wrong: it treats "civil time" and "absolute instants" as different types. You cannot answer "what's 30 days from 2024-03-08 in America/New_York" without picking a side — DST means that's either 29d23h or 30d0h of elapsed time, and most APIs silently pick one without telling you.

    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's `zoneinfo` only landed in 3.9 and `datetime.timezone` still has sharp edges.

  • smartmic 8 hours

    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/

    burntsushi 5 hours

    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.

  • e40 6 hours

    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.

  • onceonceonce 1 hours

    been hand-rolling date -d plus a wrapper script for newsletter scheduling for years. Stuff like "next second Tuesday after a holiday" and "convert these timestamps to a reader's local time before send". biff time seq monthly -w 2-tue would have replaced about 40 lines of bash for me.

    burntsushi 1 hours

    Yes!!! To spell it out (with the new biff -> bttf name):

        $ bttf time seq monthly -w 2-tue -u 1y | bttf time fmt -f '%c'
        Tue, Jun 9, 2026, 11:15:11 AM EDT
        Tue, Jul 14, 2026, 11:15:11 AM EDT
        Tue, Aug 11, 2026, 11:15:11 AM EDT
        Tue, Sep 8, 2026, 11:15:11 AM EDT
        Tue, Oct 13, 2026, 11:15:11 AM EDT
        Tue, Nov 10, 2026, 11:15:11 AM EST
        Tue, Dec 8, 2026, 11:15:11 AM EST
        Tue, Jan 12, 2027, 11:15:11 AM EST
        Tue, Feb 9, 2027, 11:15:11 AM EST
        Tue, Mar 9, 2027, 11:15:11 AM EST
        Tue, Apr 13, 2027, 11:15:11 AM EDT
        Tue, May 11, 2027, 11:15:11 AM EDT
    
    More examples here: https://github.com/BurntSushi/biff/blob/master/GUIDE.md#date...

    Implementing the RFC 5545 recurrence rules was quite a lot of fun: https://github.com/BurntSushi/biff/blob/4c75d5cf6e09310e74ca...

    I'm quite proud of it, because if you look at the implementation, it's almost entirely about dealing with the specification rules. All of the datetime bullshit (including handling time zones) is all deferred to Jiff.

    Plus, the tests are nearly 4,000 lines. While the implementation is 2,000 lines.

    jayknight 52 minutes

    I implemented those recursion rules (probably very poorly) years ago. I still often think about the ways I did and probably should have handled those. It was an interesting problem.

  • burntsushi 5 hours

    I'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.)

    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 |
            biff tag exec git log -n1 --format='%aI' |
            biff time in system |
            biff time sort |
            biff time fmt -f '%a %Y-%m-%d %H:%M:%S' |
            biff 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 |
            biff tag exec git log -n1 --format='%aI' |
            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 '%a %Y-%m-%d %H:%M:%S' |
            biff 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, `biff tag exec` is using parallelism under the hood to make this even faster.

    christoff12 2 hours

    This is pretty neat. My proficiency with the command line is woefully underdeveloped and seeing examples like this help me see the possibilities.

    Crontab 5 hours

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

    skydhash 4 hours

    Quick Note: You can put the pipe operator where your backslash is and you won’t have to escape the newline character. Works in bash, zsh and ksh (what I’ve tested).

    burntsushi 4 hours

    Oh nice thank you!

  • elcaro 9 hours

    % biff

    2026 M05 28, Thu 17:27:46

    Ahh, the month of M05

    5 hours

    croisillon 7 hours

    just between a04 and j06 yes

    raverbashing 6 hours

    Looking forward to the J07 04 holiday

    burntsushi 5 hours

    This is a fair critique actually. And this shouldn't be the default. It is for now because I haven't gotten around to making Biff read your POSIX locale settings and converting them to a Unicode locale. If you build with `cargo build --release --features locale` (or get Biff from a release binary), then you can do:

        $ BIFF_LOCALE=en-US biff
        Thu, May 28, 2026, 6:38:09 AM EDT
    
    If that doesn't work, then you can enable logging to see an error message:

        $ BIFF_LOCALE=watwat BIFF_LOG=warn biff
        2026-05-28T06:39:08.876336708-04:00[America/New_York]|WARN|src/main.rs:76: reading `BIFF_LOCALE` failed, using unknown locale `und`: failed to parse `BIFF_LOCALE` environment variable: The given language subtag is invalid
        2026 M05 28, Thu 06:39:08
    
    What you're seeing is what ICU4X does when the user's locale is unknown or undetermined. The `M` prefix occurs to indicate that the number is the month, and is unrelated to the name. For example:

        $ BIFF_LOCALE=watwat biff time fmt -f '%c' '1 month'
        2026 M06 28, Sun 06:39:50

    aftbit 1 hours

    I came here to complain about this. Please read `LANG` like everything else :)

    burntsushi 46 minutes

    Oh yes definitely. Was always the plan. I was honestly just hoping someone would publish a crate to do that for me.

    To be clear, I don't mean publishing a crate to read an environment variable. Of course. I mean a crate that converts a POSIX locale into a Unicode locale.

    I guess there's probably a 20% solution that gets 80% of the way there. e.g.,

        $ BTTF_LOCALE="$(echo $LANG | sed 's/_/-/' | sed 's/\..*//')" bttf
        Thu, May 28, 2026, 11:46:21 AM EDT
    
    If Biff just did that as a stop-gap until the full solution lands, I bet it would work in lots of cases.

  • ramon156 7 hours

    Same dude that made jiff. Love that library, so I'm assuming biff is built on top of jiff.

    rippeltippel 6 hours

    also made ripgrep

    zokier 3 hours

    And xsv. Burntsushi projects have certain quiet sensibility that I appreciate.

    Crontab 2 hours

    I only recently realized that xsv is now unmaintained. The author now suggests using qsv or xan.

  • yzydserd 9 hours

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

    maybewhenthesun 7 hours

    exactly. and chromium is a good looking space shooter with too few levels!

    throw0101a 5 hours

    I.e.,

        NAME
           biff -- be notified if mail arrives and who it is from
        
        […]
        
        HISTORY
           The biff command appeared in 4.0BSD.  It was named  after  the  dog  of
           Heidi Stettner. He died in August 1993, at 15.
    
    * https://man.freebsd.org/cgi/man.cgi?query=biff

        Eric Cooper, a student contemporary to Foderero and 
        Stettner, reports that the dog would bark at the mail 
        carrier,[4][5] making it a natural choice for the name 
        of a mail notification system. Stettner herself 
        contradicts this.[3][6]
    
    * https://en.wikipedia.org/wiki/Biff_(Unix)

    teddyh 5 hours

    Also: <https://manpages.debian.org/stable/biff/biff.1.en.html>

    dcminter 3 hours

    From the excellent "A Quarter Century of UNIX" (by the late Peter H. Salus):

    Heidi would bring her dog with her to class and to her office. He was a very friendly dog, and a lot of the students enjoyed throwing a ball for him down the corridor to fetch. He even had his picture on the bulletin board with the graduate students: the legend read that he was working on his Ph.Dog. John decided to name the program after the dog: Biff. According to Heidi, John and Bill Joy then spent a lot of time trying to compose an explanation for biff - they came up with "Be notified if mail arrived." Biff, who died in August 1993, at 15, once got a B in a compiler class. According to Heidi, the story of Biff barking at the mailman is a scurrilous canard.

    One of my favourite bits of trivia from that excellent book, but hardly anyone I bump into these days knows anything about that kind of multi-user Unix experience/environment these days. I barely caught any of it myself.

    burntsushi 1 hours

    Yeah this was before my time. I never did email from a terminal. Which probably explains why I was okay with naming it Biff.

    In any case, I've renamed the project to bttf: https://github.com/BurntSushi/bttf/pull/14

    sourcegrift 17 minutes

    I dont think it's part of the unix standard. Biff sounds perfect

    nine_k 5 hours

    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.

    4 hours

    raverbashing 8 hours

    Yes I'm sure root is anxious to read all the mail in their local mailbox

    roryirvine 7 hours

    Sending mail to root@<whatever> really did use to be a pretty reliable way of getting somebody useful's attention - the early-to-mid 90s equivalent of making a "Can someone from Google please unlock my account?" post on HN.

    throw0101a 5 hours

    Under Debian/Ubuntu, when Postfix is installed, part of the standard list of questions that dpkg-reconfigure asks you is how you want mail flow to work: you can give it a central smarthost. So any local mail gets sent on, and on the central mail hub you can tell it to send root@ to someplace useful:

    * https://wiki.debian.org/Postfix#Forward_Emails

    burntsushi 5 hours

    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

    fnordpiglet 1 hours

    B1FF IS LIMITED TO 22 COLUMNZ

    hk1337 4 hours

    Griff is still available for future projects or Buford if you create a throwback project.

    jacobobryant 1 hours

    As the author of a different project also named Biff, I do have to warn you that half the comments on your HN posts will be people quoting back to the future--though I haven't decided yet if that's annoying or an engagement hack!

    [1] https://github.com/jacobobryant/biff

    burntsushi 48 minutes

    Back to the Future jokes never get old. I love it.

    I still want one of those hover boards!

    throw0101c 5 hours

    > 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?

    burntsushi 5 hours

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

    dredmorbius 41 minutes

    Per Debian policy and precedence of the email notification utility, you'll install biff, the command-line email notification utility:

    <https://www.debian.org/doc/debian-policy/ch-binary.html#the-...>

    <https://packages.debian.org/trixie/biff>

    abrowne 1 hours

    I know that if you want `fd` (https://github.com/sharkdp/fd) you need to `apt install fd-find` and which installs the binary `fdfind` (!).

    m463 1 hours

    > Yeah the name collision is unfortunate, but probably fine.

    collisions, lol

      % apt-cache search biff
      biff - a mail notification tool
      gnubiff - mail notification program for GNOME (and others)
      wmbiff - Dockable app that displays information about mailboxes
      xlbiff - mail notification pop-up with configurable message scans
    
    (along with 9 more matches without biff in command name)

    dredmorbius 44 minutes

    Those are:

    1. Not precise name collisions.

    2. All mail-notification utilities, as was the original biff.

    And since we're mentioning Debian, it has a policy requiring unique names within the Debian archive to be unique. Precedence goes to the earlier software packaged. Installed programs must also have unique names within a given system. The datetime Swiss army knife utility discussed here violates both policies.

    As Debian policy is used both for Debian and derived distros (see: <https://en.wikipedia.org/wiki/List_of_Linux_distributions#De...> for a partial listing), it has considerable influence.

    burntsushi 36 minutes

    I've renamed the project to bttf :-)

    dredmorbius 30 minutes

    That works on Debian ;-)

    <https://packages.debian.org/search?keywords=btff>

    Might want to ping the mods (hn@ycombinator.com) to update this submission title.

    eb0la 5 hours

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

    dredmorbius 40 minutes

    docbrown would be more appropriate, as the character who's actually doing the time manipulation.

    burntsushi 5 hours

    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.

    mehackernewsacc 21 minutes

    Naming is hard, sure, but doing some due diligence up front to see what's already being used isn't very difficult. Very neat tool.

    Terretta 4 hours

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

    // backronym bttf stands for biff time to format

    burntsushi 1 hours

    You win the naming contest. The project has been renamed: https://github.com/BurntSushi/bttf/pull/14

    burntsushi 1 hours

    @dang - Could you update the post title please to say "bttf" instead of "Biff"? Thank you!

    burntsushi 4 hours

    I like this

    hnlmorg 18 minutes

    This is the fastest rebranding after a Show HN I think I’ve seen haha

    christoff12 2 hours

    also: back to the future

    bbkane 1 hours

    Burntsushi to the future

    nicce 1 hours

    Intersting to notice that the name has been changed now when reading the post 12h late :-D