A simple question, but i couldn't find it:
Is the range of HOUR_OF_DAY between 0 and 23, or 1 and 24?
I want a random HOUR_OF_DAY, do I need:
int randomHour = (int) (Math.random()*24);
int randomHour = (int) (Math.random()*24+1);
From the documentation:
Field number for get and set indicating the hour of the day.
HOUR_OF_DAYis used for the 24-hour clock. E.g., at 10:04:15.250 PM the
If 10:04:15.250 PM is
HOUR_OF_DAY 22, That would make the range
23. If it were
24, 10 p.m. would be 23. And that would be wrong on so many levels. :-)