Getting Binary Data in 01 Format

Hi there,

My need is to get the exact date and time of my LinkedIn posts instead of their relative date.

To that end, based on an algorithm explanation that I found here and here, I’m trying to convert the ID of each post to binary data.

But instead of getting a sequence of 0s and 1s as expected, I get a sequence of 2-digit numbers.

Reading some posts on the forum, I learnt that applying the toString() function to the output of toBinary() might help. But it didn’t, it just rendered the initial post ID.

Do you guys know how I can get a string of 0s and 1s?

Thanks.

Hello @JBJ,

You could try this series of modules.
It uses 11 ops, but you could probably simplify it a bit more.
LinkedIn Post ID to Datetime.json (18.3 KB)

Basically it uses a combination of Text Aggregator and Math modules to string together text that makes up a large equation, compute it (result is a string of 0 and 1 separated by commas), turns it into an array using split(), reverses it using reverse(), takes the first 41 bits using slice(), string together another set of pieces using Text Aggregator to make up a second large equation, compute that (which results in the unix timestamp), then finally convert the unix timestamp back into a readable date and time.

Using your input as an example
image

The result was
image

Not sure if that’s anywhere near what you’re expecting?

Give it a go, hopefully it works. Might need some tweaks to get it to work just right.