Как преобразовать DateTime jodatime в LocalDateTime java - PullRequest
0 голосов
/ 22 января 2020

Я пробовал это:

LocalDateTime.ofInstant(dateTime.toInstant(), ZoneId.systemDefault()))

Но это дает ошибку времени компиляции:

The method ofInstant(java.time.Instant, java.time.ZoneId) in the type LocalDateTime is not applicable for the arguments (org.joda.time.Instant, java.time.ZoneId)

1 Ответ

0 голосов
/ 22 января 2020

Это работает:

LocalDateTime.ofInstant(Instant.ofEpochMilli(startDateTime.getMillis()), ZoneId.systemDefault()))
...