Comments (2)
Hi,
Somehow I missed this big time.
Can you please raise a PR to do this? Probably an environment variable which the utility would read and follow.
from pdd.
There are issues with using strftime
. Here's a crude example:
~/G/pdd$ gd
diff --git a/pdd b/pdd
index f1d48e7..f679222 100755
--- a/pdd
+++ b/pdd
@@ -19,8 +19,8 @@
import argparse
import calendar as cal
-from datetime import date
-from datetime import datetime
+import datetime
+#from datetime import datetime
from dateutil.relativedelta import relativedelta
import os
import sys
@@ -129,14 +129,8 @@ def showtimediff(t0, t1):
m, s = divmod(abs(t0 - t1), 60)
h, m = divmod(m, 60)
- d, h = divmod(h, 24)
-
- if d > 0:
- print('day %d, %02d:%02d:%02d' % (d, h, m, s))
- else:
- print('%02d:%02d:%02d' % (h, m, s))
-
- print('%ds' % abs(t0 - t1))
+ t = datetime.time(h, m, s)
+ print(t.strftime('%H %M %S'))
def showtimesum(t0, t1):
~/G/pdd$ ./pdd -t 28:00:00 1:01:59
error: hour must be in 0..23
Currently this works like a charm and shows the number of days.
from pdd.
Related Issues (15)
- diff default to today HOT 2
- pypi invitation HOT 2
- Can it "add" more than two timestamps? HOT 1
- python 3.8 problem
- How to use the zsh_completion.py script ? HOT 9
- pip install ppd fails for python 3.10.4 and 3.10.8 on macOS 12.6 (Monterey) HOT 4
- [advice] Change shtab HOT 1
- new pypi release HOT 2
- feature: command line option -v, --version HOT 3
- Use ISO 8601 format [YYYY MM DD] in dates
- use of /now argument results in an error HOT 4
- Windows support may be limited HOT 22
- Availability on PyPI HOT 6
- Add MANIFEST.in HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdd.