KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
This caused me a bit of a headache last night and I wanted to understand why the getDate method in the Date object is 1 based (returns values from 1-31) while the getMonth method is 0 based (returns 0-11). I'm wondering why there is this inconsistency in methods for the same object. I understand why it's difficult to change the behavior now but are there any reasons this was designed like this in the first place? Documentation can be found here: http://www.w3schools.com/jsref/jsref_obj_date.asp
Tags (comma-separated)
Save Edits
Cancel