Find the day of the year

PHOTO EMBED

Wed Jan 05 2022 11:20:53 GMT+0000 (UTC)

Saved by @desiboli ##javascript ##js

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

Find which is the day by a given date.

https://blog.devgenius.io/15-javascript-codes-you-will-always-need-e8569903dd1