title: Java - SimpleDateFormat formatter to return epoch time with milliseconds
body: <p>I am very new to Java and coding in general - I have some code which returns a timestamp in the following format <code>yyyy.MM.dd HH:mm:ss:ms</code> which is shown below:</p>
  
  <pre><code>SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss:sss");
  </code></pre>
  
  <p>This returns:</p>
  
  <pre><code>2017.07.19 11:42:30:423
  </code></pre>
  
  <p>Is there a way to edit the "SimpleDateFormat formatter" code above to return the date/time as an epoch timestamp that includes milliseconds so that the value returned is formatted as per the below?</p>
  
  <pre><code>1500464550423
  </code></pre>
  
  <p>I'm hoping that I can amend the <code>("yyyy.MM.dd HH:mm:ss:sss")</code> part of the <code>SimpleDateFormat formatter</code> code to do this.</p>
  
  <p>Any help or advice is much appreciated.</p>
  
  <p>Thanks</p>