Live data from Hacker News

Never write your own date parsing library

zachleat.com

71–80 of 333 posts

Re: Never write your own date parsing library

#71
post #61

Earlier quoted context omitted.

Vernor Vinge had it figured out in A Deepness in the Sky with the use of kiloseconds, megaseconds, and gigaseconds.

A second is still originally defined as 1/86400 of an Earth day. That doesn't make it unusable as a cross galactic time unit, and I think the same goes for years and hours.

The issue is that planetary locales will each have their own days and years (and possibly hours), so it would be confusing to adopt that same nomenclature for an interplanetary/interstellar time unit. And since the latter will be inconsistent with local time systems anyway, it’s easier to just have it use powers of ten. At least until we meet aliens that may prefer a different base.

Re: Never write your own date parsing library

#72
post #58

Earlier quoted context omitted.

Every time someone mentioned "days" or "months" or "years" in Andor I had to mentally zap my brain not to think about how it doesn't make a sense across a galaxy.

Consider it a translation convention. There's a time and a place for "cycles" or "rels" or whatever, but it gets into "Calling a Rabbit a 'Smeerp'" [1] territory pretty quickly. The payoff isn't really all that great. Stargate SG-1 is one of my favorite instances of this. The first couple of episodes address the fact that the Earth characters do not speak the same languages as everyone else in the galaxy. Then, havin…

I think that these fundamental things can be turned into an interesting topic, but you have to try for it.

Like, in a story background I'm pushing around, there's a coalition of a large amount of species developed on different planets. And you're a military officer, and you need to coordinate shifts, but - assuming some collectively normalized number of hours - some of your tiny dudes are tuned to 3 hours of sleep, 3 hours of leisure and 3 hours of work, others weird dudes with 2 arms and 2 legs are tuned to 38 hour cycles, and some huge dudes with a trunk in their face are tuned to 356 hour cycles.

Even if you could train and adjust this by an hour or two (which, for the 3 hour dudes would compare to an 8 earth-hour extension of duty for us), how the heck would you coordinate any kind of shifts across this? Or does every species have their own schedule? Good look finding crossover meetings then. Some of the small guys would have to do overtime for longer meetings even.

But you have to make it a point of the story and the challenges if you want to include it. If it is just a weird side note, just say that they figured out a conversion and that's it.

Re: Never write your own date parsing library

#73
post #69

Earlier quoted context omitted.

A second is still originally defined as 1/86400 of an Earth day. That doesn't make it unusable as a cross galactic time unit, and I think the same goes for years and hours.

Case-in-point, you are mistaken. The duration of a day changes due to many things, both logically and also physically due to the nature of Earth. Also just because you can call a second a second doesn't mean that is helpful making datetime software usable or easy on a different planet.

I think he's speaking historically. Obviously now a second is a fundamental SI unit defined in terms of physics experiments, but the origin of it was as the amount of time that was 1/3600th of an hour of which there are 24 in the day.

Re: Never write your own date parsing library

#74

Multiple times in my career I've had a good laugh when a non-technical manager says something along the lines of "it's just the date, how hard can it be?"

Add phone numbers, email addresses and human names to the list.

What do you mean we shouldn't have a first and last name input?

explains the naming conventions of every culture on the planet

Re: Never write your own date parsing library

#75
post #71

Earlier quoted context omitted.

A second is still originally defined as 1/86400 of an Earth day. That doesn't make it unusable as a cross galactic time unit, and I think the same goes for years and hours.

The issue is that planetary locales will each have their own days and years (and possibly hours), so it would be confusing to adopt that same nomenclature for an interplanetary/interstellar time unit. And since the latter will be inconsistent with local time systems anyway, it’s easier to just have it use powers of ten. At least until we meet aliens that may prefer a different base.

[deleted]

Re: Never write your own date parsing library

#76
post #12

It's like that joke someone posted on Twitter: "I was in favor of space exploration until I realized what it would mean for date/time libraries"

Every time someone mentioned "days" or "months" or "years" in Andor I had to mentally zap my brain not to think about how it doesn't make a sense across a galaxy.

Babylon 5 times.

https://babylon5.fandom.com/wiki/Measurements_of_Time

Aliens use phrases like " 2 of your Earth days "

Re: Never write your own date parsing library

#77
post #61

Earlier quoted context omitted.

Vernor Vinge had it figured out in A Deepness in the Sky with the use of kiloseconds, megaseconds, and gigaseconds.

A second is still originally defined as 1/86400 of an Earth day. That doesn't make it unusable as a cross galactic time unit, and I think the same goes for years and hours.

Seconds are now (in SI) defined as calculated from behavior of cesium-133 atoms.

https://en.wikipedia.org/wiki/Caesium_standard

Re: Never write your own date parsing library

#78
post #58

Earlier quoted context omitted.

Every time someone mentioned "days" or "months" or "years" in Andor I had to mentally zap my brain not to think about how it doesn't make a sense across a galaxy.

Consider it a translation convention. There's a time and a place for "cycles" or "rels" or whatever, but it gets into "Calling a Rabbit a 'Smeerp'" [1] territory pretty quickly. The payoff isn't really all that great. Stargate SG-1 is one of my favorite instances of this. The first couple of episodes address the fact that the Earth characters do not speak the same languages as everyone else in the galaxy. Then, havin…

> The payoff isn't really all that great.

If you’ve read David Weber’s Safehold series, this point gets super clear. It's written with names like "Zherald Ahdymsyn" (Gerald Adamson), but that makes it quite the slog for many.

Re: Never write your own date parsing library

#79
No other programming concept has caused me more grief than dealing with time and timezones. It starts to get really mind-bendingly complex once you start thinking about it deeply. That is even before you start encountering the quirks (some places have timezone changes that depend not only on the time of year but also on the actual year). Lesson learnt - choose a library (moment is great) and never think about time again.
Post reply on HN