oh my fucking god php is such a fucking trainwreck
in particular its date handling leaves QUITE A LOT to be desired
I mean there's also the big security hoobajoob but that's not the bit that's frustrating me at the moment
Discussion
oh my fucking god php is such a fucking trainwreck
in particular its date handling leaves QUITE A LOT to be desired
I mean there's also the big security hoobajoob but that's not the bit that's frustrating me at the moment
out of desperation I asked Gemini and it gave answers which look correct but involve writing a LOT more code than should be necessary for this
okay to be fair the easy way I'd do this in Python would involve importing arrow but it'd still result in a nice simple oneliner
but gosh, so much of the php standard library is just a thin wrapper around the C standard library, with a little bit of jank-ass object conversion
this isn't even for a thing I care about per se, I was just surprised to learn that a thing I wrote like 20 years ago and occasionally glance at has been doing it based on gmtime this whole time, since I usually only look at it in the morning
searching stackoverflow only finds things that are either wildly incorrect or answering a completely different question (often a different question than what's being asked too)
all I'm trying to do is get the numeric day of the week in the local timezone
date("W") goes based on GMT or needs a UNIX timestamp in localtime
localtime() returns a structured datetime array and I don't see any way to convert that into a UNIX timestamp
I don't see any way to do date formatting based on a datetime array
what a miserable fucking language