1PDD(1) User Commands PDD(1)
2
3
4
6 pdd - Tiny date, time difference calculator with timers.
7
9 pdd [OPTIONS] [KEYWORDS ...]
10
12 pdd (python3 date diff) is a small utility to calculate date and time
13 difference. It can also be used as a timer. If no program arguments are
14 specified it shows the current date, time and timezone.
15
16 Features
17
18 - easy to use, minimal dependencies
19 - calculate date and time difference
20 - add, subtract duration (timeslice) to/from date (time)
21 - calculate diff from today and now
22 - countdown timer with command piggybacking
23 - custom resolution stopwatch
24 - non-verbose mode for background timers
25 - show current date, time and timezone
26 - follows ISO 8601
27
28 Operational notes
29
30 - ISO 8601 format. Month can be specified as month number (e.g. Jan -
31 1, Dec - 12).
32 - Time is in 24-hr format.
33 - The absolute difference is shown. Argument order is ignored.
34 - The end date is excluded in date difference calculations.
35 - Hour, minute or second can be omitted. Partial inputs are recognized
36 as mm:ss or ss.
37 - The keybind to stop timers is Ctrl-C.
38
40 -h, --help
41 Show help text and exit.
42
43 -d, --date yyyy mmm dd [yyyy mmm dd | y m d]
44 Calculate date difference.
45
46 -t, --time hh:mm:ss [hh:mm:ss | h:m:s]
47 Calculate time difference.
48
49 --add Add a duration or timeslice to date (/today) or time (/now).
50
51 --sub Subtract a duration or timeslice from date (/today) or time
52 (/now).
53
54 --day yyyy mmm dd
55 Show the day of the week on a date.
56
57 -c, --timer hh:mm:ss
58 Set a countdown timer with duration in hours, minutes and sec‐
59 onds.
60
61 -r, --run command
62 Run command when countdown timer reaches 0.
63
64 -s, --stopwatch [resolution]
65 Start a custom resolution stopwatch. resolution can range from 1
66 to 9. Default 3 for millisecond.
67
68 -q, --quiet
69 Quiet mode for a countdown timer or stopwatch to be run in the
70 background. The counter is shown only when Ctrl-C is pressed.
71
73 1. Calculate diff from today:
74
75 $ pdd 2014 Jan 15
76
77 2. Calculate diff from now:
78
79 $ pdd 24:00:00
80 $ pdd 0
81
82 3. Calculate date diff:
83
84 $ pdd -d 1983 jul 3 2014 1 15
85
86 4. Calculate time diff:
87
88 $ pdd -t 45:50 6:17:33
89
90 5. Show current date, time and timezone:
91
92 $ pdd
93
94 6. Specify time with roll-over:
95
96 $ pdd -t 5:80:75 6:17:33
97
98 7. Add a duration (3 years, 2 months, 1 day) to 28 Feb, 2000:
99
100 $ pdd -d 2000 FEB 28 3 2 1 --add
101
102 8. Add a timeslice (1 hour 2 mins 3 secs) to 23:45:37:
103
104 $ pdd -t 23:45:37 1:2:3 --add
105
106 9. Add a duration (3 years, 2 months, 1 day) to today:
107
108 $ pdd 3 2 1 --add
109
110 10. Add a timeslice (1 hour 2 minutes 3 seconds) to now:
111
112 $ pdd 1:2:3 --add
113
114 11. Subtract a duration (1 day) from 1 Mar, 2000:
115
116 $ pdd -d 2000 Mar 01 0 0 1 --sub
117
118 12. Subtract a timeslice (1 sec) from midnight:
119
120 $ pdd -t 00:00:00 0:0:1 --sub
121
122 13. Subtract a duration (3 years, 2 months, 1 day) from today:
123
124 $ pdd 3 2 1 --sub
125
126 14. Subtract a timeslice (1 hour 2 minutes 3 seconds) from now:
127
128 $ pdd 1:2:3 --sub
129
130 15. Show the day of the week on 15 Jan 2014:
131
132 $ pdd --day 2014 Jan 15
133
134 16. Start a countdown timer or stopwatch in quiet mode in the back‐
135 ground:
136
137 $ pdd -qs &
138 $ pdd -qc 3:0:0 &
139
140 To see the final counter run fg and press Ctrl-C.
141
142 17. Run a command when countdown timer reaches 0:
143
144 $ pdd -c 00:00:5 -r 'ps -aux'
145 $ pdd -c 00:00:5 -r 'notify-send pdd expired'
146
148 Arun Prakash Jana <engineerarun@gmail.com>
149
151 https://github.com/jarun/pdd
152
154 https://github.com/jarun/pdd/issues
155
157 Copyright © 2017 Arun Prakash Jana <engineerarun@gmail.com>
158
159 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/li‐
160 censes/gpl.html>.
161 This is free software: you are free to change and redistribute it.
162 There is NO WARRANTY, to the extent permitted by law.
163
164
165
166Version 1.7 03 Dec 2022 PDD(1)