Java - SimpleDateFormat formatter to return epoch time with milliseconds [duplicate]
问题 This question already has answers here : Convert a date format in epoch (5 answers) Closed 2 years ago . I am very new to Java and coding in general - I have some code which returns a timestamp in the following format yyyy.MM.dd HH:mm:ss:ms which is shown below: SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss:sss"); This returns: 2017.07.19 11:42:30:423 Is there a way to edit the "SimpleDateFormat formatter" code above to return the date/time as an epoch timestamp that