• he/him

Coder, pun perpetrator
Grumpiness elemental
Hyperbole abuser


Tools programmer
Writer-wannabe
Did translations once upon a time
I contain multitudes


(TurfsterNTE off Twitter)


Trans rights
Black lives matter


Be excellent to each other


UE4/5 Plugins on Itch
nte.itch.io/

posts from @Turfster tagged #one of the reason why I can't take any of these new-fangled toy languages seriously

also:

gravity-pike
@gravity-pike

Every dev knows that working with dates and times sucks. Common knowledge holds that this is because dates are a human construct, and that devs make bad assumptions, like "there are 365 days in a year" or "there are 24 hours in a day" or "there are 60 seconds in each minute." And this is true! But it's also the case that devs have been done dirty by datetime libraries that don't let you be specific about what you're talking about.

Every time a Javascript date-picker returns a Date object, I die a little bit, because it's actually returning a date + time + timezone, and then it's left up to convention how to interpret this. Should the date be midnight in the local time zone? Should it be in UTC? Should it be at noon in the local time zone to maximize liklihood that the date portion will be the same in both local and UTC time zones? I've seen all three!

Java's time library fixes this. It follows the JSR 310 spec, largely based on the Joda-Time library which comprehensively lays out all of the different things that you might be talking about when you ask what time it is.


NireBryce
@NireBryce

you do not want to know how the Go datetime library works


srxl
@srxl

The layout string used by the Parse function and Format method shows by example how the reference time should be represented.

ok, what's the format

We stress that one must show how the reference time is formatted, not a time of the user's choosing.

wait. what

Thus each layout string is a representation of the time stamp, Jan 2 15:04:05 2006 MST

??????????? EXCUSE ME????????? what the fuck do you MEAN

An easy way to remember this value is that it holds, when presented in this order, the values: 1 2 3 4 5 6 -7

NO FUCK OFF!!!! that is fucked up!!!! that's not ok!!!!! why is the last one fucking NEGATIVE for no apparent reason???? WHY DOES IT HAVE TO BE THIS DATE WHAT THE FUCK ARE YOU ON!!!!!!!!! strftime is RIGHT FUCKING THERE why are you reinventing the wheel IN THE MOST BATSHIT UNHINGED WAY POSSIBLE fuck off!!!!!!!!!!! how does anyone take this language seriously????????

There are some wrinkles illustrated below.

yeah, i fuckin bet.