News for hackers. Stuff that matters.
Re:ISO name change for Türkiye by wongarsu on Tuesday July 12, 2022 @08:26AM (#32068831)
I think that's the point, people insist on using 23:59:59 as end of day instead of the correct 24:00:00 (which happens to be the same instant as 00:00:00 of the next day, since there's no gap between days)
Re:ISO name change for Türkiye by twawaaay on Tuesday July 12, 2022 @08:33AM (#32068910)
My working theory on why this happens is that there are two different models and people sometimes have problem choosing the correct one.

When you say "Thursday" you mean entire 24h period. It is not a point in time, it is a label for a span of time.

But when you say "1 pm" you don't mean an entire hour, you mean a point in time that is more or less precisely 1pm.

It seems people extend the first model to a lot of cases where it is not correct. And so for many people their mental model of 23:59:59 is a label for a span of time that is one second in length.

If your model is that a day consists of 86400 "seconds", each second being a span of time of length of one second with a label like 12:37:28, then 23:59:59 is the last second of the day and 00:00:00 is the first second of the next day.

Re:ISO name change for Türkiye by rhn_mk1 on Tuesday July 12, 2022 @09:18AM (#32069472)
Working with spans is fraught with peril, though. It invites off-by-one errors.

If there's one person in the queue to the checkout, then span-wise, that person is the start of the queue and the end of the queue. But if the start and end are the same, what is the length of the queue?

(If you still insist it's one, you'll not be able to answer the question where the start and end of an empty queue is. There is no first or last person!)

Re:ISO name change for Türkiye by jl6 on Tuesday July 12, 2022 @08:55AM (#32069172)
Fun fact, ISO 8601 used to allow 24:00:00 notation (as a synonym of 00:00:00), but in the latest version of the standard it does not.
Re:ISO name change for Türkiye by emsixteen on Tuesday July 12, 2022 @09:45AM (#32069837)
Honest question, what are you supposed to do instead?
Re:ISO name change for Türkiye by twawaaay on Tuesday July 12, 2022 @10:01AM (#32070077)
You add 1 day (not 24 hours) to beginning of day. If you have a good library it should handle it correctly.
Re:ISO name change for Türkiye by greenshackle2 on Tuesday July 12, 2022 @10:21AM (#32070378)
> 1 day (not 24 hours)

Just to spell it out, some days have 25 hours or 23 hours due to daylight savings, or 24 hours and 1 second because of leap seconds, etc.

Re:ISO name change for Türkiye by jhgb on Tuesday July 12, 2022 @02:07PM (#32073658)
Well you clearly can't use 24:00:00 universally as the end of your day because sometimes there's a 24:00:01 on some days?
Re:ISO name change for Türkiye by throwaway294566 on Tuesday July 12, 2022 @05:33PM (#32075972)
You can. The leap second is always 23:59:60
Re:ISO name change for Türkiye by jhgb on Tuesday July 12, 2022 @05:39PM (#32076023)
Yep, I may have forgotten about that. Shame on me.
Re:ISO name change for Türkiye by noSyncCloud on Tuesday July 12, 2022 @09:58AM (#32070035)
Not understanding this complaint.

```TSQL select cast('2022-07-12 24:00:00' as datetime) ``` >>> The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

```python from datetime import datetime d: datetime = datetime(2022, 7, 12, 24, 0, 0) ``` >>> ValueError: hour must be in 0..23