My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 172: date.getMonth() always show the before month
1 person starred this issue and may be notified of changes. Back to list
Status:  Done
Owner:  ----
Closed:  Nov 2009


Sign in to add a comment
 
Reported by my.nik...@gmail.com, Nov 9, 2009
What steps will reproduce the problem?
1. var m=date.getMonth()
2.alert(m);


What is the expected output? What do you see instead?
This month should show 11,but it shows 10.

What version of the product are you using? On what operating system?
1.4

Please provide any additional information below.
Though when alerting the single number,it is wrong,but new date(y,m,d) is
right.It's so strange.
Nov 9, 2009
#1 mcpata2...@gmail.com
getMonth() in javascript returns 0 - 11 (0 = January, 11 = December). Since the post 
is made on November, I suppose you're expecting 11 = November, however, the value of 
10 for November is correct for Javascript style (as well as Perl).
Nov 9, 2009
#2 my.nik...@gmail.com
Got this.Thanks!
Nov 10, 2009
Project Member #3 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Done
Sign in to add a comment

Powered by Google Project Hosting