开发者

get number of day in javascript date object

//27 <- today day number
new Dat开发者_高级运维e().getDay() = new Date().getUTCDay() //<- 5 (friday)? what?

Do I have to parse the result with .toString() or use something like YUI.Date.format()?


You're looking for .getDate():

new Date().getDate();

.getDay() returns the day number 0 (Sunday) to 6 (Saturday).


The one you are looking for is .getDate(), not .getDay()

Date Object Reference


You should use

new Date().getDate()


getDay and getUTCDay returns the number of the weekday. You need getDate() and etUTCDate()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜