Get day of year - Node.js Date

Node.js examples for Date:Year

Description

Get day of year

Demo Code

Date.prototype.getDOY = function() {
  var onejan = new Date(this.getFullYear(),0,1);
  return Math.ceil((this - onejan) / 86400000);
}

Related Tutorials