You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the official tutorial Python API and running dateutils.hours("2019-6-3 20:1:12", "2020-5-3 13:13:13") will give an answer of 8009, different from 8034 given by the tutorial.
delta_days == 0 means less than 24 hours. To check if they are the same day, something like start.day == end.day should be used instead. Similar mistake occurs when delta_days not equals to 0.
Since dateutils is implimented using datetime, this part can be improved:
OK, I think the datediff() (not only the hours()) function needs more check. Using more timedelta.days and timedelta.seconds could help making the code more clear to avoid bugs.
Activity
LadderOperator commentedon Feb 14, 2022
I think this part leads to the problem:
delta_days == 0means less than 24 hours. To check if they are the same day, something likestart.day == end.dayshould be used instead. Similar mistake occurs whendelta_daysnot equals to 0.Since
dateutilsis implimented usingdatetime, this part can be improved:LadderOperator commentedon Feb 14, 2022
OK, I think the
datediff()(not only thehours()) function needs more check. Using moretimedelta.daysandtimedelta.secondscould help making the code more clear to avoid bugs.