的代碼是從這個頁面: https://github.com/reddit/reddit/blob/master/r2/r2/lib/db/_sorts.pyx有一行reddit的代碼(排名功能)讓我困惑
這裏是代碼片段:
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?