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
}
mail_outline
Send comment, question or suggestion to howto@rgagnon.com
Send comment, question or suggestion to howto@rgagnon.com