怎么判断当前日期为月末? 怎么判断当前日期为月末?或者月末的前一天 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 得到某月的天数:alert((new Date(2007,2,0)).getDate()) 得到某月的天数:alert((new Date(2007,2,0)).getDate()) 得到某月的天数:alert((new Date(2007,2,0)).getDate()) http://blog.csdn.net/muxrwc/archive/2007/11/01/1860903.aspx可以参考这篇文章 http://blog.csdn.net/muxrwc/archive/2007/11/01/1860903.aspx可以参考这篇文章 <SCRIPT LANGUAGE= "JavaScript">var date = new Date();var year = date.getYear(); //当前年份var month = date.getMonth() + 1; //当前月份var day = date.getDate(); //当前日var lastDay; //最后一天 if (month == 2)//2月的特殊处理 判断闰年 { if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) { lastDay = 29; } else { lastDay = 28; } } else if (month == 4 || month == 6 || month == 9 || month == 11)//4 6 9 11月30天 { lastDay = 30; } else//1 3 5 7 8 10 12月31天 { lastDay = 31; } //判断当日是否为最后一天 if(lastDay == day) { alert("今日为月末最后一天"); } else { alert("今日非月末最后一天"); }</SCRIPT> 100分求修改js:实现ul中最后一个li的style.borderRight设为none 求教一个有关ext的问题 新手问题!动态改变元素属性! 请教关于查找关键字 求js判断浏览器版本 数字与Array数组length的比较 这样的js写法有没有产生闭包? 请问IE9不支持 obj.style.display这样的访问吗? 怎么样取<body><img src="..."></body><html></html>中body里面的值或者img相关的值啊? 哪里可以下到javascript语法和函数参考的书? 一个下拉框的JS问题,请哪位高手帮帮忙 求助一个正则表达式的问题,有点小难度
alert((new Date(2007,2,0)).getDate())
alert((new Date(2007,2,0)).getDate())
alert((new Date(2007,2,0)).getDate())
可以参考这篇文章
可以参考这篇文章
var date = new Date();
var year = date.getYear(); //当前年份
var month = date.getMonth() + 1; //当前月份
var day = date.getDate(); //当前日
var lastDay; //最后一天
if (month == 2)//2月的特殊处理 判断闰年
{
if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)
{
lastDay = 29;
}
else
{
lastDay = 28;
}
}
else if (month == 4 || month == 6 || month == 9 || month == 11)//4 6 9 11月30天
{
lastDay = 30;
}
else//1 3 5 7 8 10 12月31天
{
lastDay = 31;
} //判断当日是否为最后一天
if(lastDay == day)
{
alert("今日为月末最后一天");
}
else
{
alert("今日非月末最后一天");
}
</SCRIPT>