date - javascript getDate getMonth returns wrong month -
this question has answer here:
- unexpected javascript date behavior 3 answers
i know there have been other posts can't see figure out doing wrong here. below code:
var d = new date(); var month = d.getmonth(); system.log(d); system.log(month);
my output looks this:
[2015-04-01 09:24:53.012] [i] wed apr 01 2015 09:24:53 gmt-0400 (edt) [2015-04-01 09:24:53.012] [i] 3
shouldn't bottom output 4?
thanks in advance
it array. month starts 0, should plus 1 yourself.
you can take @ :)
Comments
Post a Comment