Date: December 16th, 2009
Cate: JS, 解決小問題
Tags: , ,  

IE & Firefox getYear() 共用Function

Firefox 和 IE Date物件的 getYear的定義不同
Firefox取得會比IE少1900

1
2
3
4
5
6
function firefoxGetYear(pYear){
     if(pYear<1900){
           return pYear+1900
     }
     return pYear
}

Leave a Reply

 Name

 Mail

 Home

[Name and Mail is required. Mail won't be published.]