I am using JodaTime 1.6.2.
I have a LocalDate
that I need to convert to either a (Joda) LocalDateTime
, or a java.sqlTimestamp
for ormapping.
The reason for this is I have figured out how to convert between a LocalDateTime
and a java.sql.Timestamp
:
LocalDateTime ldt = new LocalDateTime();
DateTimeFormatter dtf = DateTimeFormatter.forPattern("yyyy-MM-dd HH:mm:ss");
Timestamp ts = Timestamp.valueOf(ldt.toString(dtf));
So, if I can just convert between LocalDate
and LocalDateTime
, then I can make the continued conversion to java.sql.Timestamp
. Thanks for any nudges in the right direction!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…