When starting from ajava.util.date object: what is the best way getting the hour part as an integer regarding performance?
java.util.date
integer
I have to iterat
In UTC:
int hour = (int)(date.getTime() % 86400000) / 3600000;
or
long hour = (date.getTime() % 86400000) / 3600000;