The code below gives me the current time. But it does not tell anything about milliseconds.
public static String getCurrentTimeStamp() { SimpleDateForm
Ans:
DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"); ZonedDateTime start = Instant.now().atZone(ZoneId.systemDefault()); String startTimestamp = start.format(dateFormatter);