<script type="text/javascript">
function show(){
var today = new Date();
var year = today.getFullYear();
var month = today.getMonth() + 1;
var lastDay = new Date(year, month, 0); //次月第一天的前一天
alert(
"当前月第一天:" + year + "-" + month + "-01" + "\n" +
"当前月最后一天:" + year + "-" + month + "-" + lastDay.getDate()
);
}
</script>
<input type="button" onclick="show()" value="Show"/>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-12
  • 2021-12-31
  • 2022-02-28
  • 2022-12-23
  • 2022-02-25
猜你喜欢
  • 2022-12-23
  • 2021-12-29
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
  • 2021-08-21
相关资源
相似解决方案