datefmt(1)
πΈ 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/--afterhas a default of2000-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
- nixos 26.05: datefmt 0.2.2
- nixpkgs unstable: datefmt 0.2.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms