Bob Avallone Bob Avallone - 1 year ago 60
Javascript Question

Javascript code only works in IE

I have this simple JavaScript code to find the current year. It only works in IE. I tried three other browsers . No error just nothing returned.

today = new Date()
var header = (customDateString(today))
header + ""


Answer Source

This may help you @bob

    var today = new Date(),
       header = today.getFullYear();