Hi to All,
is it possible to obtain the day Date in the consecutive year's days form (001...366) .
Tanks in advance.
Gianni Pinna.
function getDayOfYear(_dDate) {
// get milliseconds of the date and substract the milliseconds of the first day of that year
// then calculate that back into days (1 day == 86400000 milliseconds)
return Math.ceil( (new Date(_dDate.getFullYear(), _dDate.getMonth(), _dDate.getDate()) - new Date(_dDate.getFullYear(), 0, 1)) / 86400000) + 1;
}
Users browsing this forum: No registered users and 8 guests