datefmt(1)

πŸ“¦ version 0.2.2, in nixos 26.05, nixpkgs unstable

🌸 datefmt(1) β€” format timestamps in text streams 🌸

ok so bestie. datefmt is a General Commands Manual girlie and she's literally here to make ur log files cute. Let me tell u everything πŸ’…

✨ NAME ✨

datefmt β€” format timestamps in text streams πŸŽ€

✨ SYNPOSIS ✨

like, here's the whole vibe of how u call her:

datefmt [--after timestamp] [--before timestamp] [--past] [--future]
[--version] [--ms]

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this: datefmt is a tool that formats timestamps in text streams. no cap, that's the whole thing.

like, say you've got a log file with unix timestamps in it (ugh, raw numbers, not the vibe 😭). you literally just pipe it to datefmt and she converts those timestamps into formatted dates. that's it. that's the magic. she ate and left no crumbs πŸ’–

πŸ‘‘ OPTIONS πŸ‘‘

every single flag, laid out like a little menu. pick ur faves πŸ“

  • -a, --after <timestamp> β€” only format timestamps after this date (default: 2000-01-01Z). so anything older gets left alone, respectfully πŸ™ˆ
  • -b, --before <timestamp> β€” only format timestamps before this date
  • -p, --past β€” only format timestamps in the past
  • -f, --future β€” only format timestamps in the future
  • -m, --ms β€” interpret timestamps as milliseconds instead of seconds. tiny units, big energy ⭐
  • -r, --relative β€” relative timestamp formatting
  • --version β€” display version and exit. short and sweet, she's iconic like that 🫢

🌈 FORMAT 🌈

a strftime(3) format string, bestie. it defaults to '%F %R' β€” that's the default look, and honestly it's serving πŸ’…

and!!! the default can be changed with the DEFAULT_DATEFMT environment variable. so u can customize her whole aesthetic, iykyk ✨

πŸ’œ EXAMPLE πŸ’œ

here's a real one, copy it, live it, love it:

datefmt --after $(date -d yesterday +%s) %R < log.txt

see what she did there? --after + yesterday's timestamp + a %R format, all streamed in from log.txt. chef's kiss πŸ”₯


ok so quick lil PSA reminder: -a/--after has a default of 2000-01-01Z, so if u don't pass it, that's the line in the sand. don't get caught out πŸ’€

and that's the whole page, bestie! 🧚 this gorgeous little manual is datefmt(1) from the source/version dated 1980-01-01 β€” yeah she's vintage AND she's thriving, main character energy fr fr. mwah πŸ’‹πŸŒΈ

πŸ“¦ where this page comes from