You can use one of the next ways to do what you want.
1) Create a DateTime
with the TimeZone
and the hour that you want.
DateTime dt = new DateTime()
.withHourOfDay(9)
.withZone(DateTimeZone.forID("America/Los_Angeles"));
And then compare dt
with the DateTime
that you receive, create, etc.
dt.isAfter(date)
or dt.isBefore(date)
2) You can set the TimeZone
that you want to a copy of the DateTime
that you receive.
I say copy because DateTime
object is immutable. You can not modify the DateTime which you receive but create one from it, yes. You can read more about that here: Why are Joda objects immutable?
datePST = date.withZone(DateTimeZone.forID("America/Los_Angeles"));
int hour = datePST.getHourOfDay()
Now you just need to check if hour is < or > than 9.