代码来自此页面: https ://github.com/reddit/reddit/blob/master/r2/r2/lib/db/_sorts.pyx
这是代码片段:
cpdef double epoch_seconds(date):
"""Returns the number of seconds from the epoch to date. Should
match the number returned by the equivalent function in
postgres."""
td = date - epoch
return td.days * 86400 + td.seconds + (float(td.microseconds) / 1000000)
我认为td.days * 86400
应该等于td.seconds
以及(float(td.microseconds) / 1000000)
,我想知道他们为什么不简单地让 td.seconds 乘以 3?