`
guoxuepeng
  • 浏览: 38634 次
文章分类
社区版块
存档分类
最新评论

JS取当前日期和时间

 
阅读更多
<script><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">var myDate = new Date();</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">myDate.getYear();</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//获取当前年份(2位)</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//alert(myDate.getYear()) //2009</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">myDate.getFullYear();</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//获取完整的年份(4位,1970-????)</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//alert(myDate.getFullYear()); 2009</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">myDate.getMonth();</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//获取当前月份(0-11,0代表1月)</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//alert(myDate.getMonth()); //7(实际是8月)</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">myDate.getDate();</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//获取当前日(1-31)</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//alert( myDate.getDate()); //13</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">myDate.getDay();</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//获取当前星期X(0-6,0代表星期天)</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//alert(myDate.getDay()); //4 代表星期四</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">myDate.getTime();</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//获取当前时间(从1970.1.1开始的毫秒数)</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">myDate.getHours();</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//获取当前小时数(0-23)</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//alert(myDate.getHours()); //9 代表9点</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">myDate.getMinutes();</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//获取当前分钟数(0-59)</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//alert(myDate.getMinutes()); //45 分</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">myDate.getSeconds();</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//获取当前秒数(0-59)</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//alert(myDate.getSeconds()); //40 秒数</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">myDate.getMilliseconds();</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//获取当前毫秒数(0-999)</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">myDate.toLocaleDateString();</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//获取当前日期</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">var mytime=myDate.toLocaleTimeString();</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//获取当前时间</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//alert(mytime);//9:40:18</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">myDate.toLocaleString( );</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//获取日期与时间</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//alert( myDate.toLocaleString( )); //2009年8月13日 9:40:58</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">&lt;/script&gt;</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">如果想取双份的月和日,要自己加判断进行处理,例如:</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">&lt;script&gt;</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">function curDateTime() {</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">var d = new Date();</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">var year = d.getYear();</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">var month = d.getMonth() + 1;</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">var date = d.getDate();</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">var day = d.getDay();</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">var curDateTime = year;</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">if (month &gt; 9)</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">curDateTime = curDateTime + month;</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">else</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">curDateTime = curDateTime + "0" + month;</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">if (date &gt; 9)</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">curDateTime = curDateTime + date;</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">else</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">curDateTime = curDateTime + "0" + date;</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">//myform.kprq.value = curDateTime;</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">alert("当前日期"+curDateTime);</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"></span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">document.getElementByIdx_x("date").value=curDateTime;</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">}</span><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left"><span style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left">&lt;/script&gt;</span></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr><wbr style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left; background-color:rgb(138,138,138)"><br style="color:rgb(50,62,50); font-family:Arial,sans-serif,Helvetica,Tahoma; line-height:18px; text-align:left; background-color:rgb(138,138,138)"></wbr>
分享到:
评论

相关推荐

    Js获取当前日期时间及格式化代码

    标题中的知识点:Js获取当前日期时间及格式化代码。 描述中的知识点:介绍了如何使用JavaScript(Js)获取当前的日期和时间,并提供了一个格式化日期时间的代码示例。 标签中的知识点:涉及到Js在获取日期时间方面...

    用记事本编写简单javascript获取当前日期和时间.doc

    标题中的“用记事本编写简单javascript获取当前日期和时间”指的是使用文本编辑器(例如Windows系统的记事本)来创建一个HTML文件,并在其中嵌入JavaScript代码,以实现动态显示网页上的当前日期和时间的功能。...

    js获取当前时间yyyymmddhhmmss

    js获取当前时间yyyymmddhhmmss js获取当前时间yyyymmddhhmmss js获取当前时间yyyymmddhhmmss js获取当前时间yyyymmddhhmmss js获取当前时间yyyymmddhhmmss js获取当前时间yyyymmddhhmmss js获取当前时间...

    js获取系统当前时间

    使用JavaScript获取当前日期和时间 在提供的代码示例中,主要通过`new Date()`来创建一个新的`Date`对象,该对象表示当前的日期和时间。然后通过一系列的方法来获取年份、月份、日期等具体信息。 #### `new Date...

    Js获取当前日期时间及其它操作

    Js获取当前日期时间及其它操作 还有一些自己风装好的方法,很好用,也很全。js的日期判断。

    Js获取当前日期时间及其它操作 .doc

    1. **获取当前日期时间**: - `new Date()`:创建一个表示当前日期和时间的新Date对象。 - `myDate.getYear()`:返回当前年份(两位数)。 - `myDate.getFullYear()`:返回完整的四位数年份。 - `myDate....

    js在线当前时间和日期

    下面我们将详细讨论如何在JavaScript中实现在线获取当前日期和时间,以及如何判断是上午AM还是下午PM。 1. **Date对象**:JavaScript中的`Date`对象是处理日期和时间的核心。创建一个Date对象会自动初始化为当前的...

    JavaScript显示当前时间和日期

    它首先获取当前日期时间的信息,然后通过`document.getElementById('time')`找到页面上对应id的元素,并更新其innerHTML属性来显示时间。 ### 总结 以上就是关于如何使用JavaScript在网页上显示当前时间和日期的...

    js获取当前时间显示在页面上并每秒刷新

    js获取当前时间显示在页面上&lt;/title&gt; [removed] [removed]=function(){ //定时器每秒调用一次fnDate() setInterval(function(){ fnDate(); },1000); } //js 获取当前时间 function fnDate(){ var oDiv=...

    js获取当前时间yyyy-mm-dd-hh-mm-ss

    我们可以创建一个新的Date实例来获取当前日期和时间,然后使用各种方法来提取年、月、日、小时、分钟和秒。下面是一个详细的步骤: 1. 创建Date对象实例: ```javascript var now = new Date(); ``` 2. 获取...

    JS获取当前日期时间-kaic

    本文将详细讲解如何使用JavaScript获取当前日期时间,并解释代码中`getCurrentTime`函数的工作原理。 首先,JavaScript中的`Date`对象是处理日期和时间的核心。创建一个新的`Date`对象会自动初始化为当前日期和时间...

    JS获取当前时间日期

    JS中获取当前的日期和时间,方便在JSP页面获取时间

    js获取当前日期前N天或者后N天的日期,简单方便(附源码).pdf

    在JavaScript中,获取当前日期前或后的指定天数是一项常见的任务,这在处理日期相关的功能时非常有用,比如日历应用、数据分析等。本篇将详细介绍如何使用JavaScript实现这一功能,并提供一个简洁实用的示例代码。 ...

    js获取页面上的时间和当前时间进行比较判断

    ### JS 获取页面上的时间和当前时间进行比较判断 在前端开发中,经常需要处理与时间相关的逻辑,例如验证用户输入的时间是否有效、判断某个事件是否已经过期等。本篇文章将详细解析如何使用JavaScript来获取页面上...

    在页面上显示当前日期和时间

    在上面的代码中,我们使用 JavaScript 的 Date 对象来获取当前日期和时间。首先,我们创建了一个 Date 对象,并将其赋值给变量 now。然后,我们使用 getHours() 方法来获取当前小时数,并根据小时数来判断当前是上午...

    JS 获取当前的时间

    在JavaScript中,获取当前时间是一项基础且常见的任务。JavaScript提供了内置的Date对象,可以用来创建、操作和格式化日期和时间。这篇博文将探讨如何利用JS获取当前的时间,并通过一个简单的示例——`demo.html`...

    JS获取当前时间并格式化"yyyy-MM-dd HH:mm:ss"

    例如,如果我们想要获取当前日期的"yyyy-MM-dd"格式,可以这样调用: ```javascript var time1 = new Date().Format("yyyy-MM-dd"); ``` 同样,如果需要"yyyy-MM-dd HH:mm:ss"格式,可以这样调用: ```javascript ...

    js获取当前日期时间源码

    在JavaScript中,获取当前日期和时间是常见的任务,这对于创建动态网页、日志记录或处理时间相关的用户输入非常有用。`getCurrentTime()` 函数在给定的代码中提供了这一功能,它将当前时间格式化为`YYY-MM-DD HH:MM:...

    js获取当前时间

    在JavaScript中,获取当前日期和时间主要通过`Date`对象来完成。`Date`对象提供了多种方法来创建、操作和格式化日期和时间。以下是一些关键的方法: 1. **创建Date对象**: - `new Date()`:创建一个表示当前日期...

    js日期时间控件 JavaScriptjs日期时间控件 jsp

    JavaScript日期时间控件是网页开发中常用的一种组件,主要用于用户在网页上选择或输入日期和时间。在JavaScript中,处理日期和时间的核心对象是`Date`。本篇将深入探讨JavaScript日期时间控件的实现原理、使用方法...

Global site tag (gtag.js) - Google Analytics