Day of year - get days btw 1-365

PHOTO EMBED

Thu Jan 12 2023 17:21:11 GMT+0000 (Coordinated Universal Time)

Saved by @AZbrahim #javascript

const dayOfYear = date =>
  Math.floor((date - new Date(date.getFullYear(), 0, 0)) / 1000 / 60 / 60 / 24);

dayOfYear(new Date()); // 272
content_copyCOPY

https://www.30secondsofcode.org/js/s/day-of-year