title: Java Date to milliseconds
body: <p>I'm storing messages from an amazon cloud and ordering them by their timestamp in a sorted map.</p>
  
  <p>I am parsing the timestamp from the cloud with the following code:</p>
  
  <pre><code>Date timestamp = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.SSS'Z'", Locale.ENGLISH).parse(time);
  </code></pre>
  
  <p>and then I am storing in them in a sorted map with the key being the date.
  The issue is that the date only comes down to seconds precision.
  I can have several messages sent in 1 second, so I need them to be ordered with millisecond precision. Is there a data structure that allows this?</p>