timestamp

otrebu's avatarfrom otrebu

Generate deterministic timestamps in YYYYMMDDHHMMSS format using bash. Use when you need timestamps for filenames, logging, or any situation requiring consistent timestamp formatting without LLM generation.

⭐0stars🔀0forks📁View on GitHub🕐Updated Nov 18, 2025

When & Why to Use This Skill

This Claude skill provides a reliable method to generate deterministic timestamps in YYYYMMDDHHMMSS format using Bash. It ensures high precision and consistency for system-level tasks, eliminating the variability and potential hallucinations associated with LLM-generated date strings in automated workflows.

Use Cases

  • Automated File Naming: Generate unique, chronological filenames for backups, database exports, or system logs to prevent overwriting and ensure easy sorting.
  • Directory Organization: Create time-stamped folders for periodic data captures or project snapshots to maintain a clear chronological structure.
  • CI/CD Pipeline Integration: Use standardized timestamps for tagging build artifacts, versioning releases, or documenting execution times in deployment scripts.
  • Log Standardization: Append consistent time identifiers to log entries or commit messages to facilitate easier debugging and audit trails across different environments.
nametimestamp
descriptionGenerate deterministic timestamps in YYYYMMDDHHMMSS format using bash. Use when you need timestamps for filenames, logging, or any situation requiring consistent timestamp formatting without LLM generation.
allowed-toolsBash

Timestamp

Overview

Generate timestamps in YYYYMMDDHHMMSS format (e.g., 20251030143215) using bash date command for deterministic, reliable timestamp generation.

When to Use

  • Creating timestamped filenames or directories
  • Adding timestamps to logs or commit messages
  • Any situation requiring consistent timestamp formatting
  • When deterministic bash execution is preferred over LLM-generated timestamps

Usage

Always use the bash script to generate timestamps:

bash ./skills/timestamp/scripts/generate_timestamp.sh

Examples

Timestamped filename:

timestamp=$(bash ./skills/timestamp/scripts/generate_timestamp.sh)
echo "backup_${timestamp}.tar.gz"
# Output: backup_20251030143215.tar.gz

Timestamped directory:

timestamp=$(bash ./skills/timestamp/scripts/generate_timestamp.sh)
mkdir "logs_${timestamp}"

In file content:

timestamp=$(bash ./skills/timestamp/scripts/generate_timestamp.sh)
echo "Generated at: ${timestamp}" > output.txt

Format Specification

  • Format: YYYYMMDDHHMMSS
  • Example: 20251030143215
  • Breakdown:
    • YYYY: 4-digit year (2025)
    • MM: 2-digit month (10)
    • DD: 2-digit day (30)
    • HH: 2-digit hour, 24h format (14)
    • MM: 2-digit minute (32)
    • SS: 2-digit second (15)

Resources

scripts/generate_timestamp.sh

Executable bash script using date +"%Y%m%d%H%M%S" to generate timestamps in YYYYMMDDHHMMSS format.