Skip to main content

PDate converts dates to human-readable formats.

Project description

PDate

PDate make dates and times human-readable.

Install

pip install pdate_cli

Features

Quick check

$ pdate --now
1753307983

$ pdate --now --date
Wednesday, July 23, 2025 05:04:09 PM CDT

Convert: flexible input formats

# Most formats accepted, e.g. ISO-8601, RFC-2822, etc.

$ pdate 2024-11-25T20:10:46Z
Monday, November 25, 2024 02:10:46 PM CST

$ pdate 12 hours ago
Wednesday, July 23, 2025 12:07:13 AM CDT

Convert: choice of output format

$ pdate 2024-11-25T20:10:46Z --human
7 months ago

$ pdate 2024-11-25T20:10:46Z --precise
7 months, 26 days, 1 hour, 58 minutes and 24.89 seconds ago

$ pdate 2024-11-25T20:10:46Z --date --precise
Monday, November 25, 2024 02:10:46 PM CST
7 months, 26 days, 1 hour, 58 minutes and 46.01 seconds ago

Batch: read from stdin, sort, etc.

$ echo 100000000 | pdate
Saturday, March 03, 1973 03:46:40 AM CST

$ echo -e '2024-11-25T20:10:46Z\n2024-11-25T20:10:46Z\n100000000' | pdate --sort
Saturday, March 03, 1973 03:46:40 AM CST
Monday, November 25, 2024 02:10:46 PM CST
Monday, November 25, 2024 02:10:46 PM CST

Library usage

from pdate_cli.cli import parse
print(parse("10 minutes ago"))

Help pages

$ pdate --help
Usage: pdate [OPTIONS] [ARG]...

  Parse ARG and format it as a local, human-readable date.

  If ARG is missing
  - If --now: print current date (default format: Unix timestamp)
  - Else: read from stdin (default format: human-readable date)

  Supported ARG formats
  - Most date formats, e.g. ISO-8601, RFC-2822, etc.
  - Unix timestamp

  Timezone considerations
  - For dates without timezone info, UTC is assumed
  - For timestamps, local timezone is assumed

Options:
  --now       Print just current date.
  --ts        Format output as Unix timestamp.
  --date      Format output as human-readable date.
  --human     Format output as human-readable date.
  --precise   Format output as precise human-readable date.
  --verbose   Print debug information.
  --sort      Sort output by date. Implies --stdin.
  --12        Use 12-hour format.
  -h, --help  Show this message and exit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdate_cli-0.2.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdate_cli-0.2.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file pdate_cli-0.2.0.tar.gz.

File metadata

  • Download URL: pdate_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.12 Darwin/25.3.0

File hashes

Hashes for pdate_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 dc47c7abd09bb13af929eeeb6d39e235097a0bb83493f79c97f4906dc86044d8
MD5 32dd7d11634d159444b71211664a9844
BLAKE2b-256 d47ee9e7ed97ed8aa36975816b65e5f9f1cba77f4aca123f7c3bb53bdade6c97

See more details on using hashes here.

File details

Details for the file pdate_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pdate_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.12 Darwin/25.3.0

File hashes

Hashes for pdate_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85b2d63ed0e8edf726cb18393a856c0a01af4666b54e747fcd4f6351352c637d
MD5 21e297bd65fba637e34c1d2baddbbb55
BLAKE2b-256 cd935e0a49032a9c7e7fb21dfe858d3c55a2b4aed9d9358e5c01b46ad7f7b048

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page