Have year on 4 digits from a Date objectTag(s): Language


  function getYear(d) { 
    // Y2K-compliant and compatible IE and NS
    //   d  a Date object
    // returns a string 
    return (d=d.getYear())<1000 ? 1900+d : d
    }

blog comments powered by Disqus