logoalt Hacker News

wongarsutoday at 10:27 AM3 repliesview on HN

Seconds are also unambiguous. Depending on your chosen definition, "X days" may or may not be influenced by leap seconds and DST changes.

I doubt anyone cares about an hour more or less in this context. But if you want multiple implementations to agree talking about seconds on a monotonic timer is a lot simpler


Replies

woodruffwtoday at 2:12 PM

Could you explain what you mean re: ambiguity? I understand why “calendar units” like months are ambiguous, but minutes, hours, days, and weeks all have fixed durations (which is why APIs like Python’s `timedelta` allows them).

show 2 replies
myhftoday at 4:16 PM

exploiting the ambiguity in date formats by releasing a package during a leap second

sverhagentoday at 12:11 PM

I came here to argue the opposite. Expressing it in seconds takes away questions about time zones and DST.

I think you're incorrect to say that second are also ambiguous. Maybe what you mean is that days are more practical, but that seems very much a personal preference.

show 3 replies