MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/btxz72/what_are_some_javascript_things_beginners_dont/ep5ls89/?context=9999
r/javascript • u/[deleted] • May 28 '19
383 comments sorted by
View all comments
247
Months are zero based
0 u/[deleted] May 28 '19 [deleted] 34 u/Careerier May 28 '19 This is true, but that's something even beginners (hopefully) should know.The date thing is weird because months start at zero, but days, hours, seconds, and milliseconds start at 1.new Date(2019, 1, 1, 1, 1, 1) gives you Fri Feb 01 2019 01:01:01 0 u/[deleted] May 28 '19 [deleted] 12 u/throwAwayDev_ May 28 '19 I think it's fair to be angry, but unreasonable to blame JS. Useful thread 3 u/MuskasBackpack May 28 '19 I think pretty much every language has things like this. → More replies (2)
0
[deleted]
34 u/Careerier May 28 '19 This is true, but that's something even beginners (hopefully) should know.The date thing is weird because months start at zero, but days, hours, seconds, and milliseconds start at 1.new Date(2019, 1, 1, 1, 1, 1) gives you Fri Feb 01 2019 01:01:01 0 u/[deleted] May 28 '19 [deleted] 12 u/throwAwayDev_ May 28 '19 I think it's fair to be angry, but unreasonable to blame JS. Useful thread 3 u/MuskasBackpack May 28 '19 I think pretty much every language has things like this. → More replies (2)
34
This is true, but that's something even beginners (hopefully) should know.
The date thing is weird because months start at zero, but days, hours, seconds, and milliseconds start at 1.
new Date(2019, 1, 1, 1, 1, 1) gives you Fri Feb 01 2019 01:01:01
new Date(2019, 1, 1, 1, 1, 1)
0 u/[deleted] May 28 '19 [deleted] 12 u/throwAwayDev_ May 28 '19 I think it's fair to be angry, but unreasonable to blame JS. Useful thread 3 u/MuskasBackpack May 28 '19 I think pretty much every language has things like this. → More replies (2)
12 u/throwAwayDev_ May 28 '19 I think it's fair to be angry, but unreasonable to blame JS. Useful thread 3 u/MuskasBackpack May 28 '19 I think pretty much every language has things like this. → More replies (2)
12
I think it's fair to be angry, but unreasonable to blame JS. Useful thread
3 u/MuskasBackpack May 28 '19 I think pretty much every language has things like this. → More replies (2)
3
I think pretty much every language has things like this.
→ More replies (2)
247
u/TrikkyMakk May 28 '19
Months are zero based