<script>
function number(index1){
var number_string="一二三四五六七八九十";
if(index1==0){
document.write("七")}
else if(index1 < 10){
document.write(number_string.substring(0+(index1-1),index1))}
else if(index1 < 20 ){
document.write("十"+number_string.substring(0+(index1-11),(index1-10)))}
else if(index1 < 30 ){
document.write("二十"+number_string.substring(0+(index1-21),(index1-20)))}
else{
document.write("三十"+number_string.substring(0+(index1-31),(index1-30)))}
}
today1 = new Date();
month = today1.getMonth()+1;
date = today1.getDate();
today = today1.getDay();
document.write("今天是");
number(month);
document.write("月");
number(date);
document.write("日");
document.write("星期");
number(today);
</script>
str1.substring(start, end)//利用substring返回str1中 从start到end结束的字符串
substring中的start是指明子字符串的起始位置end是指明子字符串的结束位置,索引都从 0 开始起算,即返回一个包含从 start 到end-1的字符串。
珍藏多年的搜黄抠妹版软件-男人必备,今天拿出来分享要的速度: