Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if Date X is after Date Y with JodaTime

Tags:

java

jodatime

I'm using the jodatime DateTime variable. I'd like to check if DateTime 'x' is after DateTime 'y'. The isAfter function only accepts a long parameter, not a DateTime, which I find very odd. Whats the best way to compare two DateTimes?

like image 317
Mike Baxter Avatar asked Aug 30 '13 11:08

Mike Baxter


1 Answers

There is a Method boolean isAfter(ReadableInstant instant) in ReadableInstant, so as DateTime implements ReadableInstant it should accept a DateTime as well.

like image 79
piet.t Avatar answered Oct 04 '22 11:10

piet.t