Skip to content

Commit

Permalink
Workaround new IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
rojvv committed Jul 9, 2024
1 parent b88fd73 commit 940d15a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/creation_date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export function predictCreationDate(id: number) {
const d = new Date(r * 1_000);
if (isNaN(d.getHours())) return now();
if (d.getFullYear() < 2013) return now();
if (d.getFullYear() == 2013 && id >= 1_000_000_000) return now();
return d;
}
function now() {
Expand All @@ -53,3 +54,5 @@ function now() {
d.setMilliseconds(0);
return d;
}

console.log(predictCreationDate(1739206386))

0 comments on commit 940d15a

Please sign in to comment.