計算當月剩下的日子
- Internet Explorer 6.0
- Internet Explorer 7.0
- Internet Explorer 8.0
- Mozilla Firefox 2.0
- Mozilla Firefox 3.0
- Google Chrome
- Safari 3.1
- Opera 9.5
- 計算當月剩下的日子 - 計算當月與月尾之間的日子。
- 語法總長度:422 字元
<script type="text/javascript"><!--
var today = new Date();
var now = today.getDate();
var year = today.getYear();
if (year < 2000) year += 1900;
var month = today.getMonth();
var yudan113 = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) yudan113[1] = "29";
document.write("這個月還剩 " + (yudan113[month]-now) + " 天了");
// --></script>