All of the following date strings are parsed by Chrome and Firefox and produce the same time value in both browsers (even though sometimes the value can be unexpected). All of them are currently unsupported by Ladybird. I'm not sure how many of them we want to support for compatibility, but I figured it's better to have a list just in case
Saturday, October 12, 2024
12 October 2024 3:30 PM
12.10.2024
12.10.24
12 octobre 2024
12-OCT-2024
2024.10.12
10/12/24 3:30:00 PM
2024-10-12 3:30:00 PM
2024-10-12 15:30:00.000 +0000
Fri, 11 Oct 2024 22:18:51 GMT+00:00
Fri, 11 Oct 2024 22:18:51 GMT+23:59
Sat Oct 12 2024 22:18:51 GMT+00:00
Fri/11/Oct/2024 22:18:51 UTC
11.Oct.2024.22:18:51 UTC
Sat, 12-Oct-2024 15:30:00 PST
22:18:51 2024
Saturday (Oct 12) 2024
0000000
100000
Linux
N/A
N/A
N/A
N/A
<body>
<script>
// Note that following values are expected in GMT+1
const dates = [
["12 October 2024 3:30 PM", 1728739800000],
["12.10.2024", 1733785200000],
["12-10-2024", 1733785200000],
["12.10.24", 1733785200000],
["12 octobre 2024", 1728684000000],
["12-OCT-2024", 1728684000000],
["2024/10/12", 1728684000000],
["2024.10.12", 1728684000000],
["10-12-24", 1728684000000],
["10/12/24 3:30:00 PM", 1728739800000],
["10/12/2024, 12:20:39 AM", 1728685239000],
["2024-10-12 3:30:00 PM", 1728739800000],
["2024-10-12 15:30:00.000 +0000", 1728747000000],
["Fri, 11 Oct 2024 22:18:51 GMT+00:00", 1728685131000],
["Fri, 11 Oct 2024 22:18:51 GMT+23:59", 1728598791000],
["Sat Oct 12 2024 22:18:51 GMT+00:00", 1728771531000],
["Fri/11/Oct/2024 22:18:51 UTC", 1728685131000],
["11.Oct.2024.22:18:51 UTC", 1728685131000],
["Sat, 12-Oct-2024 15:30:00 PST", 1728775800000],
// How are these even valid
["22:18:51 2024", 1704143931000],
["0000000", 946681200000],
["100000", 3093527977200000],
["Saturday, October 12, 2024", 1728684000000],
["Saturday (Oct 12) 2024", 1704063600000],
];
const log = (str) => document.body.appendChild(document.createElement("pre")).textContent = str;
dates.forEach(([dateString, time]) => {
const d = new Date(dateString);
const t = d?.getTime();
if (t !== time) {
if (Number.isNaN(t)) {
log(`Unsupported: ${dateString}`);
} else {
log(`String was parsed, but time is incorrect: ${dateString} -> ${t} (expected: ${time})`);
}
}
});
</script>
</body>
N/A
No response
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too