How do I get the current weeknumber of the year, like PHP\'s date(\'W\')?
date(\'W\')
It should be the ISO-8601 week number of year, weeks starting
now = new Date(); today = new Date(now.getFullYear(), now.getMonth(), now.getDate()); firstOfYear = new Date(now.getFullYear(), 0, 1); numOfWeek = Math.ceil((((today - firstOfYear) / 86400000)-1)/7);