首頁 >web前端 >js教程 >js日期時間補零的小例子_javascript技巧

js日期時間補零的小例子_javascript技巧

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原創
2016-05-16 17:40:551338瀏覽

複製程式碼 程式碼如下:

f       var day = new Date();
           var Year = 0;
                  var CurrentDate = "";
           //初始化時間中
//Year       = day.getYear();//有火狐下2008年顯示108的bug
           Year          Month      = day.getMonth() 1 ;
           Day        = day.getDate();
        10 )
           {
            CurrentDate = Month "-";      CurrentDate = Month "-";      CurrentDate = Month
           else
           {
         }
           if (Day >= 10 )
           {            else
           {
       🎜>
           return CurrentDate;
        }

 
/////////取得在取得時間後取得的時間才能會補零
var nowdate = getNowFormatDate();



陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn