Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Day of The Year

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

dayOfYear(new Date());
// Result: 272
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #Day #The #Year
ADD COMMENT
Topic
Name
9+4 =