Live data from Hacker News

Falsehoods programmers believe about time

infiniteundo.com

51–60 of 212 posts

Re: Falsehoods programmers believe about time

#51
post #39

> A week (or a month) always begins and ends in the same year Okay, of course a week can begin in an year and end in the next, but how exactly would a month not begin and end in the same year?

Here you go: https://youtu.be/-5wpm-gesOY?t=368 I'd highly recommend watching the whole video, by the way. It's really good.

Work in Finance.

My year starts on April 1st.

I do not want my year to start on January 1st, else I will need to work through all holidays for year-end closing.

Re: Falsehoods programmers believe about time

#52
In the U.S. falling back to standard time from daylight saving time is rough. Those days have 25 hours - and the interval from 1:00 - 2:00 repeats (you reach 2:00 and fallback to 1:00 and repeat the interval). Makes power scheduling difficult - which 1:00 - 2:00 interval are you talking about?

Also, the offsets between the timezones change. Eastern Daylight Time falls back from 2:00 to 1:00 Eastern Standard Time, which coincides with 1:00 for Central Daylight Time. So Eastern Time and Central Time are the same for one hour interval. Of course in the Spring you have the opposite problem - Central Time will be 2 hours behind Eastern Time for a one hour interval. So much for your interval time calculations! Also, the U.S. has changed the transition dates for the time change.

I'm so glad to be working on a system where I no longer have to worry about this crap!

Re: Falsehoods programmers believe about time

#53
post #9

Earlier quoted context omitted.

By putting the intended audience in the title, you grab their attention more.

It's clickbait. Computerphile managed a much better title[1]: The Problem with Time & Timezones A "(for programmers)" could be appended if needed. [1] https://www.youtube.com/watch?v=-5wpm-gesOY

Its not click bait, the contents are what the title claim to be.

Re: Falsehoods programmers believe about time

#54
I don't know if these are all the same falsehoods, but—related:

Falsehoods programmers believe about time zones - https://news.ycombinator.com/item?id=24870376 - Oct 2020 (16 comments)

Falsehoods programmers believe about time (2017) - https://news.ycombinator.com/item?id=24453712 - Sept 2020 (8 comments)

Falsehoods programmers believe about Unix time - https://news.ycombinator.com/item?id=19922062 - May 2019 (268 comments)

Falsehoods Programmers Believe About Time (2012) - https://news.ycombinator.com/item?id=12675527 - Oct 2016 (154 comments)

Falsehoods programmers believe about time and time zones - https://news.ycombinator.com/item?id=11515125 - April 2016 (80 comments)

Falsehoods Programmers believe about Time - https://news.ycombinator.com/item?id=4128208 - June 2012 (213 comments)

Re: Falsehoods programmers believe about time

#55
post #20

Does anyone actually believe this? Even the most inexperienced developers I’ve worked with are well aware that time, and timezones in particular, are really difficult. I’ve yet to meet anyone that has suggested using anything other than a battle-hardened standard library for time.

I bet you could get me to give the wrong answer to most of these questions if you worded it cleverly in informal conversation, but the answer to anything time and date related in a technical setting is "Ugh, we'll have to look up the stupid edge cases here," right?

Re: Falsehoods programmers believe about time

#56
post #50

Earlier quoted context omitted.

That's what I thought. This list mixes "falsehoods" that nobody with a bit of common sense - even children - would believe, and pedantry that could be useful to 0.001% of developers. For most programs, Time starts in 1970. IMO, this list is only good at... wasting time. Except for the multiple statements (that could be one or two) that point out that there's not such a thing like "identical clocks" and "same time on…

So "most" programs can ignore birth dates of people older than 52? I don't think so.

Do most programs need to know the birth date of the user?

Re: Falsehoods programmers believe about time

#57

> A week (or a month) always begins and ends in the same year Okay, of course a week can begin in an year and end in the next, but how exactly would a month not begin and end in the same year?

There is a concept of "week year" in Java so a given month could simultaneously exist in two (week) years.

Re: Falsehoods programmers believe about time

#58
We should just define a year to be 360 days long and made up of 12 30 day months.

Then we can elect some druids or whatever to arbitrarily, at the start of each year, define which dates the seasonal borders will land on. Events which are truly dependent on weather can be defined in terms of "Days after the season starts."

Or we could define a 5.5+-.5 day holiday between the beginning and end of a given year. Those days will be declared to not belong to any year. We will turn off all our computers for those days, and pretend they didn't happen. If you are born within them, you get a special hat or something.

Re: Falsehoods programmers believe about time

#59
post #20

Does anyone actually believe this? Even the most inexperienced developers I’ve worked with are well aware that time, and timezones in particular, are really difficult. I’ve yet to meet anyone that has suggested using anything other than a battle-hardened standard library for time.

Even if you use a library, it's easy to bake in an "obvious" assumption into your program.

Such as storing location + date + time, because that should be unambiguous, right? Or confusing "same time tomorrow" with now + 24h. Are you even sure which one you need?

Re: Falsehoods programmers believe about time

#60
I've just learned to do time conversions by converting from the target timezone to UST, then from UST, to the recipient timezone.

Hasn't failed me yet.

Here's why: https://www.nist.gov/sites/default/files/images/2019/12/23/w...

This looks useful. I haven't checked for full accuracy: https://www.timeanddate.com/time/map/

Post reply on HN