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); }