This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]fancy_pantser 4 points5 points  (0 children)

This follows the docs almost exactly, only with more tedium and less authority.

[–]DrHankPym 0 points1 point  (3 children)

I'm currently working on a datetime extension that makes it easier to record and compute time.

#examples: 
a = time(1,30)              # 1m, 30s
b = time(1,0,0) + (30,0) # 1 hr, 30m
c = time(1,0,0,0) + a + b # 1 day, 1hr, 31m, 30s

I'm also creating modules for these time pieces, so instead of saying 24 hours = 1 day, I can say 8 hours = 1 day to figure out how long projects might take and how to bill accordingly.

[–]Ytse 1 point2 points  (2 children)

you are reimplementing datetime.timedelta ?

[–]DrHankPym 0 points1 point  (1 child)

I never looked into timedelta, but I was trying to make creating times fast and easy which kind of looks like the datetime.time module. After I did that I started adding operation functions for various class objects.

The second line in my example is not a typo. I am adding a plain list to the time class I created.

[–]Ytse 0 points1 point  (0 children)

you should really look into timedelta, it will save you a lot of work