joda.time.DateTime.now().toDate()
Why doesn't java.time.
offer such a method?
What is the best way of converting a java.time.LocalDateTime
to java.util.date
?
I know I could do as follows, but it doesn't feel right.
java.time.LocalDateTime date;
java.util.Date.from(date.atZone(ZoneId.systemDefault()).toInstant());
I'm asking because a java.util.Date
is still used in lots of systems, like database mappings for postgres via hibernate.