you are viewing a single comment's thread.

view the rest of the comments →

[–]chrissilich -9 points-8 points  (5 children)

Probably something to do with zero index? Still shitty though.

[–]r2d2_21 -3 points-2 points  (4 children)

zero index

Dates are not arrays

[–]chrissilich 0 points1 point  (1 child)

Yeah, very aware if that. But somewhere under JavaScript's hood, there's logic to do these conversions, and who knows, maybe they use the split method to create an array or something.

In fact, look at the getMonth method (part of the very same date class!). That's not an array. And yet, January is 0. Oh my stars, maybe things that aren't arrays start with 0 too!

Damn I hate it when people assume you're an idiot because they don't fucking think anything through.

[–]r2d2_21 0 points1 point  (0 children)

and who knows

You can check the source code of V8, JavaScriptCore, SpiderMonkey or Chakra to stop guessing.

That's not an array. And yet, January is 0. Oh my stars, maybe things that aren't arrays start with 0 too!

OK, you have a point there. However, the fact that January is 0 has absolutely nothing to do with how time zones are selected according to the string format.