/** * Create a Time object for storing a time with the time set to the specified hours and minutes. */ public Time(final int hour, final int minute) { date = time(hour, minute); }
/** * Create a Time object for storing a time with the time set to the specified time of the Java Date * object. */ public Time(final Date date) { final Calendar localTime = createCalendar(); // localTime.setTimeZone(TimeZone.getDefault()); localTime.setTimeZone(UtcTimeZone); localTime.setTime(date); this.date = time(localTime.get(Calendar.HOUR_OF_DAY), localTime.get(Calendar.MINUTE)); }
/** * Create a Time object set to the current time. */ public Time() { final Calendar cal = createCalendar(); cal.setTimeZone(TimeZone.getDefault()); cal.setTime(new Date(Clock.getTime())); date = time(cal.get(Calendar.HOUR_OF_DAY), cal.get(Calendar.MINUTE)); }