News for hackers. Stuff that matters.
Re:Go Is a Well-Designed Language by q3k on Friday January 31, 2025 @03:24AM (#42885677)
> time.Time uses its own epoch incompatible with anything else.

Could you please elaborate?

Re:Go Is a Well-Designed Language by theoryofx on Friday January 31, 2025 @03:33AM (#42885738)
time.Time uses its own epoch internally but has methods like .Unix() which convert to Unix epoch time. Never seen this be a problem.
Re:Go Is a Well-Designed Language by usrnm on Friday January 31, 2025 @04:19AM (#42886012)
It means that zero value time.Time when converted to unix time gives you a negative number corresponding to a date two thousand years ago. With the way go insists on using zero values for expressing optionality this is a rather common mistake. Interacting with anything outside the go ecosystem is done in terms of unix time and this makes it very error-prone. And I've seen this trip people off in real life. And yes, you can argue that this is programmer's fault, but this is exactly what makes it a bad design: it makes people's lives more difficult for no real purpose, just because somebody at Google wanted to feel smart that day.
Re:Go Is a Well-Designed Language by indulona on Friday January 31, 2025 @03:38AM (#42885769)
i think he means that internally, time objects simply use unix nano and the location dictates the offset. since it is internal thing, not sure why that is relevant.