How to query LocalDateTime with LocalDate?

后端 未结 5 1252
一向
一向 2021-01-22 02:49

I\'ve got a class which contains an atttribute of java.time.LocalDateTime type.

public class MyClass{
    // ...
    private LocalDateTime fecha;
    // ...
}
         


        
5条回答
  •  误落风尘
    2021-01-22 03:06

    LocalDateTime and LocalDate are incompatible types as is (although they both implement Temporal, in case you can work with that).

    Otherwise, you have a LocalDateTime#toLocalDate conversion method available.

提交回复
热议问题