← 返回
开发者工具 中文

Unixtime

Convert Unix timestamps to dates and back. Use when parsing epoch values, calculating time differences, debugging logs, or generating relative dates.
将Unix时间戳与日期相互转换。用于解析时间戳、计算时间差、调试日志或生成相对日期。
bytesagain3
开发者工具 clawhub v3.0.0 2 版本 99841 Key: 无需
★ 0
Stars
📥 628
下载
💾 6
安装
2
版本
#latest

概述

UnixTime

A Unix time utility for converting timestamps, counting down to events, and analyzing time ranges. Features millisecond detection, ISO 8601 output, and detailed duration breakdowns.

Commands

CommandDescription
----------------------
unixtime currentShow current Unix timestamp with epoch (s/ms), local, UTC, ISO 8601, day-of-year, week number
unixtime to-date Convert a Unix timestamp to readable date (auto-detects milliseconds for 13+ digit values)
unixtime to-epoch Convert a human-readable date string to Unix epoch
unixtime countdown Show time remaining until a future timestamp (or how long ago it passed)
unixtime ranges Show full duration between two timestamps (seconds through weeks)
unixtime versionShow version
unixtime helpShow available commands and usage

Requirements

  • Bash 4+ (set -euo pipefail)
  • date, awk — standard Unix utilities
  • python3 (optional, for millisecond epoch)
  • No external dependencies or API keys

When to Use

  1. Quick timestamp checkunixtime current gives epoch, local, UTC, ISO 8601, and calendar info
  2. Parsing log timestampsunixtime to-date 1700000000 or even unixtime to-date 1700000000000 (auto-detects ms)
  3. Date string conversionunixtime to-epoch '2025-06-15 14:00:00' for quick epoch lookup
  4. Event countdownsunixtime countdown shows remaining time in a breakdown
  5. Duration analysisunixtime ranges shows the gap in seconds, minutes, hours, days, and weeks

Examples

# Show current Unix time with full details
unixtime current

# Convert timestamp to date (auto-detects milliseconds)
unixtime to-date 1700000000
unixtime to-date 1700000000000

# Convert date string to epoch
unixtime to-epoch '2025-06-15 14:00:00'
unixtime to-epoch 'Jan 15 2025'

# Countdown to a future timestamp
unixtime countdown 1800000000

# Analyze a time range
unixtime ranges 1700000000 1700086400

Example Output

$ unixtime current
┌───────────────────────────────────────────────┐
│  Current Unix Time                            │
├───────────────────────────────────────────────┤
│  Epoch (s):   1773916290                       │
│  Epoch (ms):  1773916290572                    │
│  Local:       2026-03-19 18:31:30 CST          │
│  UTC:         2026-03-19 10:31:30 UTC          │
│  ISO 8601:    2026-03-19T10:31:30Z             │
├───────────────────────────────────────────────┤
│  Day of year: 78/365                           │
│  Week:        12                               │
│  Day:         Thursday                         │
└───────────────────────────────────────────────┘

$ unixtime countdown 1800000000
┌───────────────────────────────────────────────────┐
│  ⏳ Countdown                                     │
├───────────────────────────────────────────────────┤
│  Target:     1800000000 (2027-01-14 ...)          │
│  Now:        1773916290                            │
│  Remaining:  301d 12h 1m 50s                       │
├───────────────────────────────────────────────────┤
│  Seconds:    26083710                              │
│  Minutes:    434728.5                              │
│  Hours:      7245.47                               │
│  Days:       301.894                               │
└───────────────────────────────────────────────────┘

Powered by BytesAgain | bytesagain.com | hello@bytesagain.com

版本历史

共 2 个版本

  • v3.0.0 当前
    2026-03-29 17:05 安全 安全
  • v1.0.6
    2026-03-19 05:06

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,918
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,438
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 672 📥 324,481