Open Serfentum opened 4 years ago
from pytimeparse.timeparse import timeparse
from datetime import timedelta
t = timedelta(days= -1, seconds=5)
print(t) # -1 day, 0:00:05
t = timedelta(seconds=timeparse(str(t)))
print(t) # -2 days, 23:59:55
t = timedelta(seconds=timeparse(str(t)))
print(t) # -3 days, 0:00:05
t = timedelta(days= -1, seconds=-5)
print(t) # -2 days, 23:59:55
t = timedelta(seconds=timeparse(str(t)))
print(t) # -3 days, 0:00:05
t = timedelta(seconds=timeparse(str(t)))
print(t) # -4 days, 23:59:55
Hi! Thank you for your library, I just wanna know is it likely that you will add support for negative deltas? For example
timeparse('-1 days -00:00:14.513431')
gives None, why it would be nice (at least for my purpose) to get negative number of seconds in this delta. Probably also output should be the same for such input
timeparse('-1 days 00:00:14.513431')
It's not crucial and could be circumvented of course, but would be nice to have it from the box, thank you)