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
KrzysiekOP9mo ago
Ofc im using @sapphire/snowflake utility
Favna
Favna9mo ago
@kyra 🩵🩷🤍🩷🩵 @vladdy
vladdy
vladdy9mo ago
well whats the snowflake but yeah the logic for snowflakes hasn't changed in ever
kyra
kyra9mo 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
Skyra9mo 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
Favna9mo 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
vladdy9mo ago
thats what they show
Favna
Favna9mo ago
Mb
Krzysiek
KrzysiekOP9mo ago
No description
No description
Krzysiek
KrzysiekOP9mo 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?