title: How to generate time based UUIDs?
body: <p>I want to generate time-based universally unique identifier (UUID) in Java.</p>
  <p>The method <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/UUID.html#randomUUID()" rel="noreferrer"><code>java.util.UUID.randomUUID()</code></a> generates a <a href="https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)" rel="noreferrer">UUID Version 4</a> where 122 of the 128 bits are from a <a href="https://en.wikipedia.org/wiki/Strong_cryptography#Cryptographically_strong_algorithms" rel="noreferrer">cryptographically-strong</a> random number generator.</p>
  <p>How to generate a <a href="https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_1_(date-time_and_MAC_address)" rel="noreferrer">Version 1</a> (time based) UUID ? Is there a separate library for that or is it some how provided in the Java 7 API and I am missing it.</p>