epoch - Time Converter

Convert between Unix epoch timestamps and human-readable dates.

Quick Start

epoch                          # Current time
epoch 1707500000               # Epoch to human
epoch "2024-02-09 15:30:00"    # Human to epoch
epoch -u                       # Use UTC

Usage

epoch                          # Show current time in all formats
epoch <timestamp>              # Convert epoch to human
epoch "<date string>"          # Convert human to epoch
epoch -u [value]               # Use UTC instead of local time

Examples

Current Time

epoch
Output
Now (Local):
  Epoch (s):  1707500000
  Epoch (ms): 1707500000000
  ISO 8601:   2024-02-09T15:30:00
  Human:      2024-02-09 15:30:00

Epoch to Human

epoch 1707500000
Output
Epoch → Local:
  Input:    1707500000
  ISO 8601: 2024-02-09T07:33:20-08:00
  Human:    2024-02-09 07:33:20
  Day:      Friday

Human to Epoch

epoch "2024-02-09 15:30:00"
Output
Local → Epoch:
  Input:      2024-02-09 15:30:00
  Epoch (s):  1707528600
  Epoch (ms): 1707528600000

Millisecond Timestamps

Automatically detects millisecond timestamps:

epoch 1707500000000

Supported Input Formats

  • Unix epoch (seconds or milliseconds)

  • ISO 8601: 2024-02-09T15:30:00

  • Common: 2024-02-09 15:30:00

  • Date only: 2024-02-09

Dependencies

None - uses Python standard library datetime.