/** * construct from time breakdown, and the zone. * * @param zone * The time zone. * @param tb * The TimeBreakdown with the values. */ public MyTime(BasicTimeService timeService, TimeZone zone, TimeBreakdown tb) { this.timeService = timeService; GregorianCalendar cal = BasicTimeService.newCalendar(zone, tb.getYear(), tb.getMonth() - 1, tb.getDay(), tb.getHour(), tb.getMin(), tb.getSec(), tb.getMs()); m_millisecondsSince = cal.getTimeInMillis(); }
/** * Compute a time range based on a specific time. * * @return The time range that encloses the specific time. */ protected TimeRange computeRange(Time time) { // set the period to "today" (local!) from day start to next day start, not end inclusive TimeBreakdown brk = time.breakdownLocal(); brk.setMs(0); brk.setSec(0); brk.setMin(0); brk.setHour(0); Time start = timeService.newTimeLocal(brk); Time end = timeService.newTime(start.getTime() + 24 * 60 * 60 * 1000); return timeService.newTimeRange(start, end, true, false); }
String mycopyright = "copyright (c)" + " " + timeBreakdown.getYear() + ", " + user.getDisplayName() + ". All Rights Reserved. ";