4 ms·
I asked JavaScript: const { format } = Intl.DateTimeFormat("en-UK", { month: "short", day: "numeric" }); const date = new Date(2024, 1, 29); conso
by runarberg 3y ago
I asked JavaScript:
const { format } = Intl.DateTimeFormat("en-UK", { month: "short", day: "numeric" });
const date = new Date(2024, 1, 29);
console.log(format(date));
// 29 Feb
date.setYear(2025);
console.log(format(date));
// 1 Mar
const year = 1000 * 60 * 60 * 24 * 365.2425;
console.log(format(new Date(2024, 1, 29).getTime() + year));
// 28 Feb
I guess both are logical by some definition of logic.
- paulddraper 3y agoI can agree with that.