久艹网,亚洲一日韩欧美中文字幕2019,国产欧美日韩精品专区黑人,一区二区三区久久99

中山php|最優(yōu)網(wǎng)絡(luò)中山做網(wǎng)站 中山php建站

最優(yōu)良人

2011/08/25 at 14:58

js輸出當(dāng)前日期時(shí)間和星期幾

javascript輸出當(dāng)前日期時(shí)間和星期幾的方法

1,按照本地時(shí)間格式
<script type="text/javascript">document.write(new Date().toLocaleString())</script>

2自己定義格式
<script type="text/javascript">document.write(new Date().getFullYear()+'年'+(new Date().getMonth()+1)+'月'+new Date().getDate()+'日 星期'+'日一二三四五六'.charAt(new Date().getDay()))</script>

//注意:月份的算法要在原有數(shù)字上加1

標(biāo)簽:
-