📅  最后修改于: 2022-03-11 15:02:45.994000             🧑  作者: Mango
const dayOfYear = (date) =>
Math.floor((date - new Date(date.getFullYear(), 0, 0)) / 1000 / 60 / 60 / 24);
dayOfYear(new Date());
// Result: 272