title: How to print the UNIX time in a binary representation in Bash
body: <p>I recently came across information that on the 15th of May at 02:09:25 Unix time will be equal to <code>1010101010101010101010101010101</code> in binary representation.</p>
  
  <p>I wanted to find out whether it is a fake or not, so I was trying to get the current Unix time in binary. I came up with a simple prompt like this:</p>
  
  <pre><code>$ date +%s | xxd -b
  </code></pre>
  
  <p>And I got a result like this:</p>
  
  <pre><code>0000000: 00110001 00110100 00110011 00110001 00110100 00110110  143146
  0000006: 00110010 00110100 00110100 00110010 00001010           2442.
  </code></pre>
  
  <p>All in all, I got:</p>
  
  <pre><code>0011000100110100001100110011000100110100001101100011001000110100001101000011001000001010
  </code></pre>
  
  <p>But it shows <strong>much</strong> more digits than I expected. All the other variations were unsatisfactory as well such as <code>$ date "+%v %H:%M:%S" | xxd -b</code> or <code>$ date | xxd -b</code>.</p>
  
  <p>I guess, this pair of <code>date</code> and <code>xxd</code> commands is not going to give me the expected result. </p>
  
  <p>Could you tell me how can I get the current time in such a binary representation that I will get <code>1010101010101010101010101010101</code> on the 15th of May at 02:09:25?</p>
  
  <hr>
  
  <h3>Update:</h3>
  
  <p>OK, so using this online converter (<a href="http://www.mathsisfun.com/binary-decimal-hexadecimal-converter.html" rel="nofollow noreferrer">http://www.mathsisfun.com/binary-decimal-hexadecimal-converter.html</a>) I was able to get a reasonable number of digits. <strong>How can I achieve the same using bash?</strong></p>