Snowflake.deconstruct return incorrect value

Hi. Im trying to decode timestamp from message id (DiscordSnowflake.deconstruct(message.id).timestamp) but it returns me incorrect value - message has been sent at 3:32 UTC and this code returns 1722023722053
No description
10 Replies
Krzysiek
KrzysiekOP7mo ago
Ofc im using @sapphire/snowflake utility
Favna
Favna7mo ago
@kyra 🩵🩷🤍🩷🩵 @vladdy
vladdy
vladdy7mo ago
well whats the snowflake but yeah the logic for snowflakes hasn't changed in ever
kyra
kyra7mo ago
Also, that code is used in Discord.js for many createdTimestamp getters such as Message and... it's accurate to say the least s!ev [message.createdAt, new Date()];
Skyra
Skyra7mo ago
Output: ⏱ 711.58μs
[ 2024-07-27T15:39:50.797Z, 2024-07-27T15:39:50.870Z ]
[ 2024-07-27T15:39:50.797Z, 2024-07-27T15:39:50.870Z ]
Favna
Favna7mo ago
I just realized. Are you sure you're using DiscordSnowflake? Or how it was called now Base snowflake doesn't use the discord epoch
vladdy
vladdy7mo ago
thats what they show
Favna
Favna7mo ago
Mb
Krzysiek
KrzysiekOP7mo ago
No description
No description
Krzysiek
KrzysiekOP7mo ago
I don't know why, but when I've written test for it -> it started working as it should xDD

Did you find this page helpful?