java.util.date to String using DateTimeFormatter
If you are using Java 8, you should not use java.util.Date in the first place (unless you receive the Date object from a library that you have no control over). In any case, you can convert a Date to a java.time.Instant using: Date date = …; Instant instant = date.toInstant(); Since you are only interested … Read more