biff Plugin
Datetime arithmetic, parsing, formatting, timezone conversion, sequence generation, and log timestamp tagging for the command line. By BurntSushi (author of ripgrep, xsv, and jiff).
Commands
Time Formatting
biff time fmt — Format one or more timestamps
Time Arithmetic
biff time add — Add a duration to a timestamp
Duration Calculation
biff span since — Calculate the duration since a given timestamp
Utility
biff self version — Print biff version
biff _ _ — Passthrough to biff CLI
Usage Examples
- "What time is it now?"
- "Format this date as RFC 3339"
- "What will the date be 6 months from now?"
- "How long has it been since January 20th?"
- "Convert UTC timestamps in a log to my local timezone"
- "Generate the next 5 Mondays at 9am"
Installation
cargo install biff
Examples
# Print the current time
biff _ _
# Format current time as RFC 3339
biff time fmt -f rfc3339 now
# Format current time as RFC 9557 (with timezone)
biff time fmt -f rfc9557 now
# Custom format
biff time fmt -f '%Y-%m-%d %H:%M:%S %Z' now
# Format multiple relative times
biff time fmt -f '%c' now -1d 'next sat' 'last monday' '9pm last mon'
# Add a duration to the current time
biff time add -1w now
# Add natural-language duration
biff time add '1 week, 12 hours ago' now
# Add 6 months
biff time add 6mo now
# Convert time to another timezone and round to nearest 15 minutes
biff time fmt now | biff _ _ time in Asia/Bangkok | biff _ _ time round -i 15 -s minute
# Calculate duration since a date
biff span since 2025-01-20T12:00
# Calculate duration with year-level precision
biff span since 2025-01-20T12:00 -l year
# Round a duration
biff span since 2025-01-20T12:00 | biff _ _ span round -l year -s day
# Generate a sequence of the next 5 weekdays at 9am
biff _ _ time seq day today -c5 -H 9 -w mon,wed,fri
# Generate all days remaining in the current month
biff _ _ time seq daily --until $(biff _ _ time end-of month now) today
# Generate the last weekday of each of the next 12 months
biff _ _ time seq -c12 monthly -w mon,tue,wed,thu,fri --set-position -1 | biff time fmt -f '%a, %Y-%m-%d'
# Reformat timestamps in a log file to local time
biff _ _ tag lines /tmp/access.log | biff _ _ time in system | biff time fmt -f '%c' | head -n3 | biff _ _ untag -s
Key Features
- Print current time in various formats
- Format timestamps with RFC 3339, RFC 9557, or custom strftime patterns
- Parse natural-language relative times (now, -1d, next sat, last monday, 9pm last mon)
- Add/subtract durations with natural language (1 week, 12 hours ago, 6mo)
- Convert between timezones
- Round times to arbitrary increments
- Calculate durations since a given timestamp
- Round durations to desired precision
- Generate date/time sequences with filtering (weekdays, specific days)
- Tag and untag timestamps in log files for batch reformatting
Notes
- biff uses the jiff datetime library (also by BurntSushi) for high-quality parsing and arithmetic
- For locale-aware output, set BIFF_LOCALE and use a release binary or build with the locale feature
- biff supports IANA timezone names (e.g. America/New_York, Asia/Bangkok)
- Duration parsing accepts shorthand (-1w) and verbose forms ("1 week, 12 hours ago")
1---2name: biff3description: Use this skill when the user wants to format, parse, add, subtract, or compare dates and times from the command line, or manipulate timestamps in log files.4---56# biff Plugin78Datetime arithmetic, parsing, formatting, timezone conversion, sequence generation, and log timestamp tagging for the command line. By BurntSushi (author of ripgrep, xsv, and jiff).910## Commands1112### Time Formatting13- `biff time fmt` — Format one or more timestamps1415### Time Arithmetic16- `biff time add` — Add a duration to a timestamp1718### Duration Calculation19- `biff span since` — Calculate the duration since a given timestamp2021### Utility22- `biff self version` — Print biff version23- `biff _ _` — Passthrough to biff CLI2425## Usage Examples26- "What time is it now?"27- "Format this date as RFC 3339"28- "What will the date be 6 months from now?"29- "How long has it been since January 20th?"30- "Convert UTC timestamps in a log to my local timezone"31- "Generate the next 5 Mondays at 9am"3233## Installation3435```bash36cargo install biff37```3839## Examples4041```bash42# Print the current time43biff _ _4445# Format current time as RFC 333946biff time fmt -f rfc3339 now4748# Format current time as RFC 9557 (with timezone)49biff time fmt -f rfc9557 now5051# Custom format52biff time fmt -f '%Y-%m-%d %H:%M:%S %Z' now5354# Format multiple relative times55biff time fmt -f '%c' now -1d 'next sat' 'last monday' '9pm last mon'5657# Add a duration to the current time58biff time add -1w now5960# Add natural-language duration61biff time add '1 week, 12 hours ago' now6263# Add 6 months64biff time add 6mo now6566# Convert time to another timezone and round to nearest 15 minutes67biff time fmt now | biff _ _ time in Asia/Bangkok | biff _ _ time round -i 15 -s minute6869# Calculate duration since a date70biff span since 2025-01-20T12:007172# Calculate duration with year-level precision73biff span since 2025-01-20T12:00 -l year7475# Round a duration76biff span since 2025-01-20T12:00 | biff _ _ span round -l year -s day7778# Generate a sequence of the next 5 weekdays at 9am79biff _ _ time seq day today -c5 -H 9 -w mon,wed,fri8081# Generate all days remaining in the current month82biff _ _ time seq daily --until $(biff _ _ time end-of month now) today8384# Generate the last weekday of each of the next 12 months85biff _ _ time seq -c12 monthly -w mon,tue,wed,thu,fri --set-position -1 | biff time fmt -f '%a, %Y-%m-%d'8687# Reformat timestamps in a log file to local time88biff _ _ tag lines /tmp/access.log | biff _ _ time in system | biff time fmt -f '%c' | head -n3 | biff _ _ untag -s89```9091## Key Features92- Print current time in various formats93- Format timestamps with RFC 3339, RFC 9557, or custom strftime patterns94- Parse natural-language relative times (now, -1d, next sat, last monday, 9pm last mon)95- Add/subtract durations with natural language (1 week, 12 hours ago, 6mo)96- Convert between timezones97- Round times to arbitrary increments98- Calculate durations since a given timestamp99- Round durations to desired precision100- Generate date/time sequences with filtering (weekdays, specific days)101- Tag and untag timestamps in log files for batch reformatting102103## Notes104- biff uses the jiff datetime library (also by BurntSushi) for high-quality parsing and arithmetic105- For locale-aware output, set BIFF_LOCALE and use a release binary or build with the locale feature106- biff supports IANA timezone names (e.g. America/New_York, Asia/Bangkok)107- Duration parsing accepts shorthand (-1w) and verbose forms ("1 week, 12 hours ago")