From e622a379fd557bb8d3221aaa6574825c9b45fd4d Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Wed, 14 Feb 2024 14:07:14 +0500 Subject: [PATCH] core: fix object id date parsing --- packages/core/src/utils/object-id.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/core/src/utils/object-id.ts b/packages/core/src/utils/object-id.ts index a78b5ce9c..331834b93 100644 --- a/packages/core/src/utils/object-id.ts +++ b/packages/core/src/utils/object-id.ts @@ -39,12 +39,5 @@ function swap16(val: number) { } export function getObjectIdTimestamp(id: string) { - const timestamp = new Date(); - const time = - id.charCodeAt(3) | - (id.charCodeAt(2) << 8) | - (id.charCodeAt(1) << 16) | - (id.charCodeAt(0) << 24); - timestamp.setTime(Math.floor(time) * 1000); - return timestamp; + return new Date(parseInt(id.substring(0, 8), 16) * 1000); }