25 comments | Expand all CWs
what if, as a society, we just agreed to not coordinate information across time zones anymore? that would make my life a lot easier @darius when fast travelling becomes environmentally infeasible, and our global communication networks break into local partitions, or warring fractions – we won't have to coördinate any more! @darius you arrive at the train station, look at the bell tower, it say Tuesday. fuckin Tuesday. you accept it. @darius I've done enough date-related stuff with Javascript both at work and at home that I'm pretty sure I'd have shot myself if I didn't have Moment.js or Luxon tbh. @darius You'd figure the parse() method could just have an optional argument to define time zone instead of just assuming it based on formatting...? As a mainly java developer: how on earth could a date parser not take a format specification? Does it, like, guess what the format is? @grishka It does in fact guess the format if it's not ISO 8601. And since it's guessing, it assumes local time zone. No, there is no way to pass in a UTC offset and say "give me this one". @darius Yeah def cursed. The MDN docs themselves recommend not using it and suggest using a lib instead. I've used dayjs with some success: @darius do not use the JavaScript Date type under any circumstances. It is a fractal of brokenness. Also do not use any library that uses the JavaScript Date type. They might claim not to be broken but they're all broken. |
@darius Wait.... Am I understanding this correctly:
Depending on the input format, the parsed date will either be UTC or local time????
For real?
Oh no....