[英]How to get the Last Day of the Current month using javascript?
I would like to know how can we fetch the Last day of the current month using javascript. 我想知道如何使用javascript获取本月的最后一天。 Eg last day of January is Tuesday
例如,一月的最后一天是星期二
var today = new Date()
, lastOfMonth = new Date( today.getFullYear(), today.getMonth()+1, 0 )
, dayOfWeek = lastOfMonth.getDay();
dayOfWeek
now = 0 for sunday... 6 for saturday dayOfWeek
现在= 0(星期日)... 6(星期六)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.