I need to represent UNIX time as two numbers in JavaScript - first 32 bits and next 16 bits (would be enough for some time).
So, having a number that's potentially greater then 2^32 (but less then 2^48), I want to get its 0-31 bits part and 32-47 bits part as two numbers. Getting the first number is easy but the second is not due to 32-bitness of JavaScript's bit-wise operators.
I could do something like
longNumber.toString(2).substring(0, longNumber.length - 32)
to get the binary value of the second number and convert it to decimal. But I wonder is it possible to do it without string conversions?