【发布时间】:2012-12-15 16:26:25
【问题描述】:
代码来自这个页面: https://github.com/reddit/reddit/blob/master/r2/r2/lib/db/_sorts.pyx
这里是sn-p的代码:
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?
【问题讨论】: