Package: pdd
pddpdd(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.pddhas been written with only one goal - simplicity. Users shouldn't have to memorize anything.Table of ContentsFeaturesInstallationDependenciesFrom a package managerRelease packagesFrom sourceRunning standaloneUsagecmdline optionsOperational notesExamplesCopyrightFeatureseasy to use, minimal dependenciescalculate date and time differencecalculate diff fromtodayandnowadd, subtract duration (timeslice) to/from date (time)countdown timer with command piggybackingcustom resolution stopwatchnon-verbose mode for background timersshow current date, time and timezonefollows ISO 8601InstallationDependenciespddrequires Python 3.7 (or later) and thedateutilmodule.To installdateutilon Ubuntu, run:$ sudo apt-get install python3-dateutilor, using pip3:$ sudo pip3 install python-dateutilFrom a package managerInstallpddfrom your package manager. If the version available is dated try an alternative installation method.Packaging status (expand)Unlisted packagers:●PyPI(pip3 install pdd)● Termux (pip3 install pdd)Release packagesPackages for Arch Linux, CentOS, Debian, Fedora and Ubuntu are available with thelatest stable release.From sourceIf you have git installed, clone this repository. Otherwise download the latestlatest stable releaseordevelopment version(risky).Install to default location (/usr/local):$ sudo make installTo remove, run:$ sudo make uninstallPREFIXis supported, in case you want to install to a different location.Running standalonepddis a standalone utility. From the containing directory, run:$ chmod +x pdd
$ ./pddUsagecmdline optionsusage: pdd [-h] [-d yyyy mmm dd [yyyy mmm dd | y m d]]
           [-t hh:mm:ss [hh:mm:ss | h:m:s]] [--add] [--sub]
           [--day yyyy mmm dd] [-c hh:mm:ss] [-r command] [-s [resolution]] [-q]
           [keywords ...]

Tiny date, time difference calculator with timers.

positional arguments:
  keywords              diff/add/subtract from today or now

options:
  -h, --help            show this help message and exit
  -d yyyy mmm dd [yyyy mmm dd | y m d], --date yyyy mmm dd [yyyy mmm dd | y m d]
                        calculate date difference
  -t hh:mm:ss [hh:mm:ss | h:m:s], --time hh:mm:ss [hh:mm:ss | h:m:s]
                        calculate time difference
  --add                 add to date (/today) or time (/now)
  --sub                 subtract from date (/today) or time (/now)
  --day yyyy mmm dd     show day of the week on a date
  -c hh:mm:ss, --timer hh:mm:ss
                        start a countdown timer
  -r command, --run command
                        run command when countdown timer reaches 0
  -s [resolution], --stopwatch [resolution]
                        start a stopwatch [default resolution: 3 (ms)]
  -q, --quiet           quiet mode for background timer/stopwatchCompletion scripts are available for Bash, Fish and Zsh shells.Operational notesISO 8601 format. Month can be specified as month number (e.g. Jan - 1, Dec - 12).Time is in 24-hr format.The absolute difference is shown. Argument order is ignored.The end date is excluded in date difference calculations.Hour, minute or second can be omitted. Partial inputs are recognized asmm:ssorss.The keybind to stop timers isCtrl-C.ExamplesCalculate diff fromtoday:$ pdd 2014 Jan 15
5y 2m 21d
1906dCalculate diff fromnow:$ pdd 24:00:00
15:24:03
55443s

$ pdd 0
08:36:22
30982sCalculate date diff:$ pdd -d 1983 jul 3 2014 1 15
30y 6m 12d
11154dCalculate time diff:$ pdd -t 45:50 6:17:33
05:31:43
19903sShow current date, time and timezone:$ pdd
Fri 2019 Apr 5 08:37:25 ISTSpecify time with roll-over:$ pdd -t 5:80:75 6:17:33
00:03:42
222sAdd a duration (3 years, 2 months, 1 day) to 28 Feb, 2000:$ pdd -d 2000 FEB 28 3 2 1 --add
Tue 2003 Apr 29Add a timeslice (1 hour 2 mins 3 secs) to 23:45:37:$ pdd -t 23:45:37 1:2:3 --add
1 day(s) later, 00:47:40
89260sAdd a duration (3 years, 2 months, 1 day) totoday:$ pdd 3 2 1 --add
Mon 2022 Jun 06Add a timeslice (1 hour 2 minutes 3 seconds) tonow:$ pdd 1:2:3 --add
09:41:26
34886sSubtract a duration (1 day) from 1 Mar, 2000:$ pdd -d 2000 Mar 01 0 0 1 --sub
Tue 2000 Feb 29Subtract a timeslice (1 sec) from midnight:$ pdd -t 00:00:00 0:0:1 --sub
1 day(s) earlier, 23:59:59
-1sSubtract a duration (3 years, 2 months, 1 day) fromtoday:$ pdd 3 2 1 --sub
Thu 2016 Feb 04Subtract a timeslice (1 hour 2 minutes 3 seconds) fromnow:$ pdd 1:2:3 --sub
07:40:02
27602sShow the day of the week on 15 Jan 2014:$ pdd --day 2014 Jan 15
WedStart a countdown timer or stopwatch inquiet modein the background:$ pdd -qs &
$ pdd -qc 3:0:0 &To see the final counter runfgand pressCtrl-C.Run a command when countdown timer reaches 0$ pdd -c 00:00:5 -r 'ps -aux'
$ pdd -c 00:00:5 -r 'notify-send pdd "timer expired"'CopyrightCopyright © 2017Arun Prakash Jana