Snowflake Deconstructing / Converting Text to Binary

Hi there. I am looking to deconstruct a snowflake value, the users id, from an external platform so that I can return the user’s creation date on this platform. I have their User ID and need to effectively:

  1. Convert this to binary
  2. Extract the first 42 bits
  3. Convert this to a decimal
  4. Run some maths and add a certain amount to convert this into a UNIX timestamp
  5. Finally save this into bubble.

Here is the breakdown by Discord, the external platform.

I am kinda stuck on this one, I think that doing this via Toolbox is the easiest way but I am a bit of a noob with JS and if there is a Bubble way then I’d like to pursue that first.

Thanks

you wanna do this in client or backend?

in the client side through a reusable element

i made a plugin for this:

  • convert snowflake
  • error handling

live: Discord Snowflake to Timestamp Converter
editor: discord snowflake to date | Bubble Editor
plugin: Discord Snowflake converter Plugin | Bubble

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.