News for hackers. Stuff that matters.
Re:“Node.js is one of the worst things to happen to the soft... by paublyrne on Tuesday August 23, 2016 @07:17AM (#12342779)
Daylight savings time? What's the connection to the software industry?
Re:“Node.js is one of the worst things to happen to the soft... by typicalbender on Tuesday August 23, 2016 @07:27AM (#12342811)
Dealing with time-zones and daylight savings time (which countries have it and which don't) can be a very challenge and messy problem that is really easy to get wrong.

Heres a pretty good video from computerphile on the subject https://www.youtube.com/watch?v=-5wpm-gesOY

Re:“Node.js is one of the worst things to happen to the soft... by collyw on Tuesday August 23, 2016 @09:32AM (#12343540)
Won't most mainstream languages have a built in library for that sort of thing these days?
Re:“Node.js is one of the worst things to happen to the soft... by gregmac on Tuesday August 23, 2016 @10:56AM (#12344212)
Most do, but the problem is less about the library and more about understanding how to use it.

For example, if you want an event to happen in 12 hours, and it happens to be 9pm the day before daylight savings time, do you schedule it using the timezone-aware API (so it happens at 9am, which is actually 13 hours away) or 8am (which is 12 hours, but non intuitive)? What about the event that's supposed to happen every 12 hours in perpetuity?

What happens when the user/device is mobile, and crossing timezones? Which times do you use?

What happens when you're scheduling something far in advance, and then the timezone definition itself changes (as happens a few times a year) between the time you scheduled the event, and the time something actually is supposed to happen? Does the event adjust for the new definition or follow original time?

Luckily for many problem domains, the details around this don't matter too much, but this is just the tip of the iceberg with timezone challenges.

Re:“Node.js is one of the worst things to happen to the soft... by PeterisP on Wednesday August 24, 2016 @07:15AM (#12351144)
The libraries don't really help with some issues.

E.g. a rather trivial example of displaying a hourly graph/table of some measurement, including comparison with yesterday (because there are daily patterns of fluctuation).

DST means that some of days have 23 hours and some days have 25 hours. The libraries will help you make the relevant calculations, but now you have to make a decision wether the comparison that you make with "yesterday equivalent" of today's 11:00 is yesterday's 11:00 (23 hours ago) or yesterday's 10:00 (24 hours ago).

For another example, accounting of hours worked - you may have a person that has worked 25 hours in a single day, such events break some systems.

Re:“Node.js is one of the worst things to happen to the soft... by dcornu on Tuesday August 23, 2016 @10:39AM (#12344058)
They do. The problem is that the rules of DST change over time (sometimes at the very last minute https://github.com/eggert/tz/commit/868f3528a9fd60491439ce45...) and can lead to all sorts of date math bugs when comparing timestamps across timezones.
Re:“Node.js is one of the worst things to happen to the soft... by douche on Tuesday August 23, 2016 @05:20PM (#12347766)
A lot of them are... not great. Moment.js makes it somewhat bearable in JS, but the native stuff is hot garbage.
Re:“Node.js is one of the worst things to happen to the soft... by wangchow on Tuesday August 23, 2016 @08:36AM (#12343165)
Spring forward, fall back!
Re:“Node.js is one of the worst things to happen to the soft... by zaphar on Tuesday August 23, 2016 @09:12AM (#12343409)
But not every country or even every part of every country...
Re:“Node.js is one of the worst things to happen to the soft... by TeMPOraL on Tuesday August 23, 2016 @07:27AM (#12342809)
DST adds complexity to the already ugly mess timezones are. Timezones are literally driven by real-world politics, and they can be as messy as only humans can invent.

See also: http://naggum.no/lugm-time.html

Re:“Node.js is one of the worst things to happen to the soft... by manarth on Tuesday August 23, 2016 @08:02AM (#12342968)
As well as adding to the already-confusing mess of timezones and date calculations, daylight savings can change frequently, and sometimes at very short notice.

This year, Azerbaijan decided to cancel DST, and agreed the cancellation just 10 days before the scheduled clock change [1]. Egypt cancelled DST with even less notice - just 3 days! [2]

[1] http://www.timeanddate.com/news/time/no-dst-azerbaijan.html

[2] https://www.washingtonpost.com/news/worldviews/wp/2016/07/06...

Re:“Node.js is one of the worst things to happen to the soft... by OldSchoolJohnny on Tuesday August 23, 2016 @11:48AM (#12344652)
Hah! You've had a very lucky programming career indeed if you can ask that question in all seriousness.
Re:“Node.js is one of the worst things to happen to the soft... by ehnto on Tuesday August 23, 2016 @07:22AM (#12342794)
It has to be accounted for in time and date calculations and that poses a new set of challenges.

It is also just one of many geographical, cultural, and temporal challenges that need to be addressed by any business system relying on accurate international dates and timing.

Re:“Node.js is one of the worst things to happen to the soft... by PeterisP on Tuesday August 23, 2016 @09:57AM (#12343731)
Time and scheduling are a bit tricky, to say the least. It would help if there were some reasonable assumptions that you can make - for example, a day containing 24 hours. DST makes such assumptions not true.
Re:“Node.js is one of the worst things to happen to the soft... by sanderjd on Tuesday August 23, 2016 @10:56AM (#12344203)
Wow! You haven't run into DST issues in software yet?! How I envy you! If you work in the industry, you have a lot of fun unintuitive but sort of neat bugs to look forward to!