{"id":13408887,"url":"https://github.com/jarun/pdd","last_synced_at":"2025-04-13T02:26:05.055Z","repository":{"id":53751703,"uuid":"97327283","full_name":"jarun/pdd","owner":"jarun","description":":date: Tiny date, time diff calculator with piggybacked timers","archived":false,"fork":false,"pushed_at":"2024-06-21T15:22:02.000Z","size":197,"stargazers_count":377,"open_issues_count":2,"forks_count":19,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-09-30T23:17:17.382Z","etag":null,"topics":["calculator","cli","command-line","console","countdown-timer","date-time","datetime","stopwatch","terminal","timer"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jarun.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"jarun"}},"created_at":"2017-07-15T16:12:46.000Z","updated_at":"2024-07-31T10:38:51.000Z","dependencies_parsed_at":"2024-01-03T04:11:16.072Z","dependency_job_id":"0a96a169-2256-4642-bac5-0adc198b3a76","html_url":"https://github.com/jarun/pdd","commit_stats":{"total_commits":138,"total_committers":14,"mean_commits":9.857142857142858,"dds":"0.15217391304347827","last_synced_commit":"3def9018c17ac1713b449f898721cfd986d4623b"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jarun%2Fpdd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jarun%2Fpdd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jarun%2Fpdd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jarun%2Fpdd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jarun","download_url":"https://codeload.github.com/jarun/pdd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248655818,"owners_count":21140575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calculator","cli","command-line","console","countdown-timer","date-time","datetime","stopwatch","terminal","timer"],"created_at":"2024-07-30T20:00:56.153Z","updated_at":"2025-04-13T02:26:05.022Z","avatar_url":"https://github.com/jarun.png","language":"Python","readme":"\u003ch1 align=\"center\"\u003epdd\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/jarun/pdd/releases/latest\"\u003e\u003cimg src=\"https://img.shields.io/github/release/jarun/pdd.svg?maxAge=600\" alt=\"Latest release\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://repology.org/project/pdd/versions\"\u003e\u003cimg src=\"https://repology.org/badge/tiny-repos/pdd.svg?header=repos\" alt=\"Availability\"\u003e\u003c/a\u003e\n\u003ca href=\"https://pypi.org/project/pdd/\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/pdd.svg?maxAge=600\" alt=\"PyPI\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://circleci.com/gh/jarun/workflows/pdd\"\u003e\u003cimg src=\"https://img.shields.io/circleci/project/github/jarun/pdd.svg\" alt=\"Build Status\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/jarun/pdd/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-GPLv3-yellowgreen.svg?maxAge=2592000\" alt=\"License\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://asciinema.org/a/189581\"\u003e\u003cimg src=\"https://asciinema.org/a/189581.svg\" alt=\"Asciicast\" width=\"650\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n`pdd` (Python3 Date Diff) is a tiny command line utility to calculate date and time difference. It can also be used as a timer. If no program arguments are specified it shows the current date, time and timezone.\n\n`pdd` has been written with only one goal - simplicity. Users shouldn't have to memorize anything.\n\n### Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n  - [Dependencies](#dependencies)\n  - [From a package manager](#from-a-package-manager)\n  - [Release packages](#release-packages)\n  - [From source](#from-source)\n  - [Running standalone](#running-standalone)\n- [Usage](#usage)\n  - [cmdline options](#cmdline-options)\n  - [Operational notes](#operational-notes)\n- [Examples](#examples)\n- [Copyright](#copyright)\n\n### Features\n\n- easy to use, minimal dependencies\n- calculate date and time difference\n- calculate diff from *today* and *now*\n- add, subtract duration (timeslice) to/from date (time)\n- countdown timer with command piggybacking\n- custom resolution stopwatch\n- non-verbose mode for background timers\n- show current date, time and timezone\n- follows ISO 8601\n\n### Installation\n\n#### Dependencies\n\n`pdd` requires Python 3.8 (or later) and the `dateutil` module.\n\nTo install `dateutil` on Ubuntu, run:\n\n    $ sudo apt-get install python3-dateutil\n\nor, using pip3:\n\n    $ sudo pip3 install python-dateutil\n\n#### From a package manager\n\nInstall `pdd` from your package manager. If the version available is dated try an alternative installation method.\n\n\u003cdetails\u003e\u003csummary\u003ePackaging status (expand)\u003c/summary\u003e\n\u003cp\u003e\n\u003cbr\u003e\n\u003ca href=\"https://repology.org/project/pdd/versions\"\u003e\u003cimg src=\"https://repology.org/badge/vertical-allrepos/pdd.svg\" alt=\"Packaging status\"\u003e\u003c/a\u003e\n\u003c/p\u003e\nUnlisted packagers:\n\u003cp\u003e\n\u003cbr\u003e\n● \u003ca href=\"https://pypi.org/project/pdd/\"\u003ePyPI\u003c/a\u003e (\u003ccode\u003epip3 install pdd\u003c/code\u003e)\u003cbr\u003e\n● Termux (\u003ccode\u003epip3 install pdd\u003c/code\u003e)\u003cbr\u003e\n\u003c/p\u003e\n\u003c/details\u003e\n\n#### Release packages\n\nPackages for Arch Linux, CentOS, Debian, Fedora and Ubuntu are available with the [latest stable release](https://github.com/jarun/pdd/releases/latest).\n\n#### From source\n\nIf you have git installed, clone this repository. Otherwise download the latest [latest stable release](https://github.com/jarun/pdd/releases/latest) or [development version](https://github.com/jarun/pdd/archive/master.zip) (*risky*).\n\nInstall to default location (`/usr/local`):\n\n    $ sudo make install\n\nTo remove, run:\n\n    $ sudo make uninstall\n\n`PREFIX` is supported, in case you want to install to a different location.\n\n#### Running standalone\n\n`pdd` is a standalone utility. From the containing directory, run:\n\n    $ chmod +x pdd\n    $ ./pdd\n\n### Usage\n\n#### cmdline options\n\n```\nusage: pdd [-h] [-d yyyy mmm dd [yyyy mmm dd | y m d]]\n           [-t hh:mm:ss [hh:mm:ss | h:m:s]] [--add] [--sub]\n           [--day yyyy mmm dd] [-c hh:mm:ss] [-r command] [-s [resolution]] [-q] [-v]\n           [keywords ...]\n\nTiny date, time difference calculator with timers.\n\npositional arguments:\n  keywords              diff/add/subtract from today or now\n\noptions:\n  -h, --help            show this help message and exit\n  -d yyyy mmm dd [yyyy mmm dd | y m d], --date yyyy mmm dd [yyyy mmm dd | y m d]\n                        calculate date difference\n  -t hh:mm:ss [hh:mm:ss | h:m:s], --time hh:mm:ss [hh:mm:ss | h:m:s]\n                        calculate time difference\n  --add                 add to date (/today) or time (/now)\n  --sub                 subtract from date (/today) or time (/now)\n  --day yyyy mmm dd     show day of the week on a date\n  -c hh:mm:ss, --timer hh:mm:ss\n                        start a countdown timer\n  -r command, --run command\n                        run command when countdown timer reaches 0\n  -s [resolution], --stopwatch [resolution]\n                        start a stopwatch [default resolution: 3 (ms)]\n  -q, --quiet           quiet mode for background timer/stopwatch\n  -v, --version         show program's version number and exit\n```\n\nCompletion scripts are available for Bash, Fish and Zsh shells.\n\n#### Operational notes\n\n- ISO 8601 format. Month can be specified as month number (e.g. Jan - 1, Dec - 12).\n- Time is in 24-hr format.\n- The absolute difference is shown. Argument order is ignored.\n- The end date is excluded in date difference calculations.\n- Hour, minute or second can be omitted. Partial inputs are recognized as `mm:ss` or `ss`.\n- The keybind to stop timers is \u003ckbd\u003eCtrl-C\u003c/kbd\u003e.\n\n### Examples\n\n1. Calculate diff from **today**:\n\n       $ pdd 2014 Jan 15\n       5y 2m 21d\n       1906d\n\n2. Calculate diff from **now**:\n\n       $ pdd 24:00:00\n       15:24:03\n       55443s\n\n       $ pdd 0\n       08:36:22\n       30982s\n\n3. Calculate date diff:\n\n       $ pdd -d 1983 jul 3 2014 1 15\n       30y 6m 12d\n       11154d\n\n4. Calculate time diff:\n\n       $ pdd -t 45:50 6:17:33\n       05:31:43\n       19903s\n\n5. Show current date, time and timezone:\n\n       $ pdd\n       Fri 2019 Apr 5 08:37:25 IST\n\n6. Specify time with roll-over:\n\n       $ pdd -t 5:80:75 6:17:33\n       00:03:42\n       222s\n\n7. Add a duration (3 years, 2 months, 1 day) to 28 Feb, 2000:\n\n       $ pdd -d 2000 FEB 28 3 2 1 --add\n       Tue 2003 Apr 29\n\n8. Add a timeslice (1 hour 2 mins 3 secs) to 23:45:37:\n\n       $ pdd -t 23:45:37 1:2:3 --add\n       1 day(s) later, 00:47:40\n       89260s\n\n9. Add a duration (3 years, 2 months, 1 day) to **today**:\n\n       $ pdd 3 2 1 --add\n       Mon 2022 Jun 06\n\n10. Add a timeslice (1 hour 2 minutes 3 seconds) to **now**:\n\n        $ pdd 1:2:3 --add\n        09:41:26\n        34886s\n\n11. Subtract a duration (1 day) from 1 Mar, 2000:\n\n        $ pdd -d 2000 Mar 01 0 0 1 --sub\n        Tue 2000 Feb 29\n\n12. Subtract a timeslice (1 sec) from midnight:\n\n        $ pdd -t 00:00:00 0:0:1 --sub\n        1 day(s) earlier, 23:59:59\n        -1s\n\n13. Subtract a duration (3 years, 2 months, 1 day) from **today**:\n\n        $ pdd 3 2 1 --sub\n        Thu 2016 Feb 04\n\n14. Subtract a timeslice (1 hour 2 minutes 3 seconds) from **now**:\n\n        $ pdd 1:2:3 --sub\n        07:40:02\n        27602s\n\n15. Show the day of the week on 15 Jan 2014:\n\n        $ pdd --day 2014 Jan 15\n        Wed\n\n16. Start a countdown timer or stopwatch in **quiet mode** in the background:\n\n        $ pdd -qs \u0026\n        $ pdd -qc 3:0:0 \u0026\n    To see the final counter run `fg` and press \u003ckbd\u003eCtrl-C\u003c/kbd\u003e.\n\n17. Run a command when countdown timer reaches 0\n\n        $ pdd -c 00:00:5 -r 'ps -aux'\n        $ pdd -c 00:00:5 -r 'notify-send pdd \"timer expired\"'\n\n### Copyright\n\nCopyright © 2017 [Arun Prakash Jana](https://github.com/jarun)\n","funding_links":["https://github.com/sponsors/jarun"],"categories":["\u003ca name=\"calc\"\u003e\u003c/a\u003eCalculators","Python","Applications","Command-Line Productivity"],"sub_categories":["Productivity"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjarun%2Fpdd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjarun%2Fpdd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjarun%2Fpdd/lists"}