**Fast, static binary** for extracting timestamps from UUID version 7
Fast, static binary for extracting timestamps from UUID version 7.
1.2 MB · No dependencies · Cross-platform
UUID v7 embeds a 48-bit timestamp (milliseconds since Unix epoch) in its first 6 bytes. This tool extracts and formats it for human and machine consumption.
Download the latest static binary from Releases:
Linux x86_64:
curl -L https://github.com/app/uuid7time/releases/latest/download/uuid7time-linux-x86_64 -o uuid7time
chmod +x uuid7time
sudo mv uuid7time /usr/local/bin/
Linux ARM64:
curl -L https://github.com/app/uuid7time/releases/latest/download/uuid7time-linux-aarch64 -o uuid7time
chmod +x uuid7time
sudo mv uuid7time /usr/local/bin/
macOS Apple Silicon:
curl -L https://github.com/app/uuid7time/releases/latest/download/uuid7time-macos-arm64 -o uuid7time
chmod +x uuid7time
sudo mv uuid7time /usr/local/bin/
Quick build (binary exported to current directory):
git clone https://github.com/app/uuid7time.git
cd uuid7time
docker build -f Containerfile.build -o . .
Or build as container image:
docker build -t uuid7time -f Containerfile .
# Run directly: echo "UUID" | docker run -i uuid7time
Or with Rust toolchain:
cargo build --release --target x86_64-unknown-linux-musl
# Single UUID (default ISO 8601 format)
uuid7time 018d5e5e-7b3a-7000-8000-000000000000
# Output: 2024-01-31T07:14:26.746Z
# Unix timestamp (seconds)
uuid7time --unix 018d5e5e-7b3a-7000-8000-000000000000
# Output: 1706685266
# Unix timestamp (milliseconds)
uuid7time --unix-ms 018d5e5e-7b3a-7000-8000-000000000000
# Output: 1706685266746
# JSON output
uuid7time --json 018d5e5e-7b3a-7000-8000-000000000000
# Output: {"uuid":"...","timestamp_ms":1706685266746,"timestamp_sec":1706685266,"iso8601":"...","rfc3339":"..."}
# Multiple UUIDs as arguments
uuid7time UUID1 UUID2 UUID3
# From stdin (one per line)
cat uuids.txt | uuid7time --unix
# Extract from logs and sort by time
grep -oE '[0-9a-f-]{36}' app.log | uuid7time --unix | sort -n
# With jq for JSON processing
cat data.json | jq -r '.events[].id' | uuid7time --json | jq -s '.'
# Filter recent UUIDs (last hour)
cat uuids.txt | uuid7time --unix | awk -v now=$(date +%s) '$1 > now-3600'
# Database export with timestamps
psql -t -c "SELECT id FROM events" | uuid7time --unix-ms > timestamps.csv
| Format | Flag | Example |
|---|---|---|
| ISO 8601 | --iso (default) |
2024-01-31T07:14:26.746Z |
| Unix seconds | --unix, -u |
1706685266 |
| Unix milliseconds | --unix-ms, -U |
1706685266746 |
| JSON | --json, -j |
{"uuid":"...","timestamp_ms":...} |
Usage: uuid7time [OPTIONS] [UUID]...
Arguments:
[UUID]... UUID(s) to extract timestamp from
Options:
-f, --format <FORMAT> Output format: iso, unix, unix-ms, json [default: iso]
-u, --unix Output unix timestamp in seconds
-U, --unix-ms Output unix timestamp in milliseconds
-j, --json Output JSON format
-q, --quiet Suppress error messages
-h, --help Print help
-V, --version Print version
See AGENTS.md for detailed implementation documentation.
Apache 2.0
See LICENSE for details.
Issues and pull requests welcome!