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.
Hi Gianni,
Yes this is possible. For example in the module mod_datejs you find on ServoyForge (which is based on datejs) has a function that does this.
Essentially it does the following:
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;
}
Hope this helps.
Dear Robert,
I have to sincerly and profoundly be grateful and excuse with You.
Infact You promptly and efficiently posted me the solution to the DayDate problem, and only now I can write You.
I have had a tribulation period. Omnia in bonun. .
A mindful and grateful thought of esteem.
Gianni Pinna.
Hi Gianni,
Absolutely not a problem.
I hope all is well with you.