java - Compare the current EST to 2PM EST? How? -
so have piece of code return current est
date easterntime = new date(); dateformat format = new simpledateformat("h:mm a"); format.settimezone(timezone.gettimezone("est")); return format.format(easterntime);
let return x = 12:15pm
i want compare x
3:00pm est see if x before or after 3:00pm est, and/or x between 3:00pm - 6:00pm est. there way this.
we dont have use java.util.date
. take solution calendar
well
i definitely in joda time instead. if really want built-in api, need use calendar
find local time in particular time zone - joda make simpler.
you'd use datetime
in specific time zone, , possibly take localtime
compare localtime
s you've hard-coded (or read configuration file etc).
Comments
Post a Comment