askill
datetime

datetimeSafety 100Repository

Get current date and time in various formats. Use whenever you need the current date, time, timestamps, or formatted datetime values for any purpose (logging, file naming, scheduling, comparisons, etc.)

33 stars
1.2k downloads
Updated 2/28/2026

Package Files

Loading files...
SKILL.md

datetime - Current Date & Time

Get the current date and time in various formats.

Quick Reference

# Date only
date +%Y-%m-%d                    # 2025-01-15
date +%Y/%m/%d                    # 2025/01/15
date +%d-%m-%Y                    # 15-01-2025

# Date with time
date +"%Y-%m-%d %H:%M:%S"         # 2025-01-15 14:30:45
date +"%Y-%m-%dT%H:%M:%S"         # 2025-01-15T14:30:45 (ISO 8601)
date -u +"%Y-%m-%dT%H:%M:%SZ"     # 2025-01-15T14:30:45Z (UTC ISO 8601)

# Time only
date +%H:%M:%S                    # 14:30:45
date +%H:%M                       # 14:30
date +%I:%M%p                     # 02:30PM (12-hour)

# Timestamps
date +%s                          # 1705329045 (Unix epoch)
date +%s%3N                       # 1705329045123 (milliseconds)

# Human readable
date "+%B %d, %Y"                 # January 15, 2025
date "+%A, %B %d, %Y"             # Wednesday, January 15, 2025
date "+%b %d %Y"                  # Jan 15 2025

# File-safe formats (no colons/spaces)
date +%Y%m%d                      # 20250115
date +%Y%m%d_%H%M%S               # 20250115_143045
date +%Y%m%d-%H%M%S               # 20250115-143045

When to Use

Use this skill whenever you need:

  • Current date for logging or timestamps
  • Date strings for file naming
  • ISO 8601 formatted dates for APIs
  • Unix timestamps for calculations
  • Human-readable date displays
  • UTC time for cross-timezone consistency

Format Codes

CodeOutputExample
%YYear (4-digit)2025
%mMonth (01-12)01
%dDay (01-31)15
%HHour 24h (00-23)14
%MMinute (00-59)30
%SSecond (00-59)45
%IHour 12h (01-12)02
%pAM/PMPM
%sUnix timestamp1705329045
%AWeekday nameWednesday
%BMonth nameJanuary
%bMonth abbrevJan
%ZTimezonePST

Common Patterns

Log timestamp:

echo "[$(date +"%Y-%m-%d %H:%M:%S")] Event occurred"

Backup file naming:

cp file.txt "file_$(date +%Y%m%d_%H%M%S).txt"

API timestamp (UTC):

date -u +"%Y-%m-%dT%H:%M:%SZ"

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

89/100Analyzed 3/10/2026

High-quality technical reference skill for getting current date/time in bash. Provides comprehensive format codes table, quick reference examples, and common patterns. Well-structured with clear when-to-use section and tags. Scores high on actionability and clarity. Slight completeness gap (no alternative tools) but otherwise excellent reusable skill.

100
90
85
70
90

Metadata

Licenseunknown
Version-
Updated2/28/2026
PublisherDeevsDeevs

Tags

apiobservability