Languages
[Edit]
EN

Java - format current date time with milliseconds pattern eg: yyyy-MM-dd HH:mm:ss.milliseconds

11 points
Created by:
Peter-Mortensen
558

1. Overview

Edit

In java we can display current date time with milliseconds pattern when we use SSS pattern.

eg:

2. LocalDateTime - current time with milliseconds - Java 8

Edit

Output: 

3. ZonedDateTime - current time with milliseconds - Java 8

Edit

Output: 

4. Date - current time with milliseconds

Edit

Output: 

5. Calendar - current time with milliseconds

Edit

Output: 

Merged questions

Edit
  1. Java - display current time with milliseconds

References

Edit
  1. DateTimeFormatter - JavaDoc
  2. LocalDateTime - JavaDoc
  3. Date - JavaDoc
  4. SimpleDateFormat - JavaDoc
  5. Calendar - JavaDoc
  6. ZonedDateTime - JavaDoc
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Java - Date & Time

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join