private void excludeDays(String prefix, StringBuilder sb, GregorianCalendar lastDayToExclude, GregorianCalendar alreadyExcluded) { for (; alreadyExcluded.after(lastDayToExclude) || alreadyExcluded.equals(lastDayToExclude); alreadyExcluded.add(Calendar.DAY_OF_YEAR, -1)) { sb.append(",-").append(prefix).append(StringUtils.getLogstashStyleDate(alreadyExcluded.getTimeInMillis())); } }
public boolean after(Date anotherDate){ return (this.calendar.after(anotherDate.getCalendar())); }
public boolean checkLoanPayment(GregorianCalendar today) { return (today.equals(nextPayment) || today.after(nextPayment)) && nPayments > 0; }
private static Integer getDateDiff(int calUnit, Date endDate, Date startDate) { if (endDate == null || startDate == null) { return null; } // swap if startDate later than endDate boolean neg = false; if (startDate.after(endDate)) { Date temp = startDate; startDate = endDate; endDate = temp; neg = true; } // estimate the diff. startDate is now guaranteed <= endDate int estimate = (int) getEstDiff(calUnit, startDate, endDate); // convert the Dates to GregorianCalendars GregorianCalendar calendarStartDate = new GregorianCalendar(); calendarStartDate.setTime(startDate); GregorianCalendar calendarEndDate = new GregorianCalendar(); calendarEndDate.setTime(endDate); // add 2 units less than the estimate to 1st date, // then serially add units till we exceed 2nd date calendarStartDate.add(calUnit, (int) estimate - 2); for (int i = estimate - 1;; i++) { calendarStartDate.add(calUnit, 1); if (calendarStartDate.after(calendarEndDate)) return neg ? 1 - i : i - 1; } }
GregorianCalendar now2 = new GregorianCalendar(TimeZone.getTimeZone("GMT")); now2.set(year, Calendar.JANUARY, firstdate, 9, 0, 0); if (now2.after(now)) { cycle++; epoch.add(Calendar.DAY_OF_MONTH, 28); if(!epoch.after(now)) { while(true) { epoch.add(Calendar.DAY_OF_MONTH, 28); cycle++; if(epoch.after(now)) { break;
if(now.after(expires)) { return true;
for( int i=est-inc; ; i+=inc ) { gc1.add(f, inc); if( gc1.after(gc2) ) { return negative ? inc-i : i-inc;
/** * get DetectUrlFile by url * * @param url file url * @return DetectUrlFile */ public DetectUrlFileInfo getDetectUrlFile(String url) { DetectUrlFileInfo detectUrlFileInfo = mDetectUrlFileInfoMap.get(url); // check and remove if (DownloadFileUtil.isLegal(detectUrlFileInfo)) { String createDatetime = detectUrlFileInfo.getCreateDatetime(); if (!TextUtils.isEmpty(detectUrlFileInfo.getCreateDatetime())) { // check whether is longer than 24 hours(one day) Date createDate = DateUtil.string2Date_yyyy_MM_dd_HH_mm_ss(createDatetime); if (createDate != null) { GregorianCalendar createDateCalendar = new GregorianCalendar(); createDateCalendar.setTime(createDate); GregorianCalendar curDateCalendar = new GregorianCalendar(); curDateCalendar.setTime(new Date()); createDateCalendar.add(Calendar.DAY_OF_YEAR, 1);// one day, 24 hours if (curDateCalendar.after(createDateCalendar)) { // remove the cache removeDetectUrlFile(detectUrlFileInfo.getUrl()); detectUrlFileInfo = null; } } } } return detectUrlFileInfo; }
if (firstDate != null && lastDate != null && firstDate.after(lastDate)) { listErrors.add(2); listErrors.add(3);
while (gc1.after(gc2)) { gc1.add(GregorianCalendar.MONTH, -1); month--;
if (lastMonth.after(s.getDate())) { continue;
continue; if (selection.getNotAfter() != null && today.after(selection.getNotAfter().toGregorianCalendar())) { log.debug("skipping selection because of notAfter date {}", selection.getNotAfter().toString()); continue; continue; if (selection.getNotAfter() != null && today.after(selection.getNotAfter().toGregorianCalendar())) { log.debug("skipping default selection because of notAfter date {}", selection.getNotAfter().toString()); continue;
renew.setTime(cert.getNotAfter()); renew.add(GregorianCalendar.DAY_OF_MONTH,-1*a.getRenewDays()); if(renew.after(now)) { msg = String.format("X509Certificate for %s on %s has been checked on %s. It expires on %s; it will not be renewed until %s.\n", a.getMechid(), a.getMachine(),Chrono.dateOnlyStamp(now),cert.getNotAfter(),Chrono.dateOnlyStamp(renew));
renew.setTime(cert.getNotAfter()); renew.add(GregorianCalendar.DAY_OF_MONTH,-1*a.getRenewDays()); if(renew.after(now)) { msg = String.format("X509Certificate for %s on %s has been checked on %s. It expires on %s; it will not be renewed until %s.\n", a.getMechid(), a.getMachine(),Chrono.dateOnlyStamp(now),cert.getNotAfter(),Chrono.dateOnlyStamp(renew));
if (authenticationMaxAge != null) { userAuthenticationTime.add(Calendar.SECOND, authenticationMaxAge); validAuthenticationMaxAge = userAuthenticationTime.after(now); } else if (client.getDefaultMaxAge() != null) { userAuthenticationTime.add(Calendar.SECOND, client.getDefaultMaxAge()); validAuthenticationMaxAge = userAuthenticationTime.after(now);
p = c.newPerson(Person.T_DOCTOR); } else if (roll == 3) { // ASF or Proto Pilot if (c.getFaction().isClan() && c.getCalendar().after(new GregorianCalendar(3059, 1, 1)) && Compute.d6(2) < 6) { p = c.newPerson(Person.T_PROTO_PILOT); } else {
end = FullDateRange.getRandom(); if (start.after(end)) { GregorianCalendar swap = end; end = start;
end = FullDateRange.getRandom(); if (start.after(end)) { GregorianCalendar swap = end; end = start;