1Try using Joda Time instead of standard java.util.Date classes. Joda Time library has much better API for handling dates.
2
3DateTime dt = new DateTime(); // current time
4int month = dt.getMonth(); // gets the current month
5int hours = dt.getHourOfDay(); // gets hour of day
6See this question for pros and cons of using Joda Time library.
7
8Joda Time may also be included to some future version of Java as a standard component, see JSR-310.
9
10If you must use traditional java.util.Date and java.util.Calendar classes, see their JavaDoc's for help (java.util.Calendar and java.util.Date).
11
12You can use the traditional classes like this to fetch fields from given Date instance.
13
14Date date = new Date(); // given date
15Calendar calendar = GregorianCalendar.getInstance(); // creates a new calendar instance
16calendar.setTime(date); // assigns calendar to given date
17calendar.get(Calendar.HOUR_OF_DAY); // gets hour in 24h format
18calendar.get(Calendar.HOUR); // gets hour in 12h format
19calendar.get(Calendar.MONTH); // gets month number, NOTE this is zero based!