Returns a new Comparer that delegate date milliseconds minus the target date milliseconds as comparison object

@param targetDate
@return
348569
public Comparer<Long> since(String targetDate) {
		return since(this.style.from().apply(targetDate));
	}
1093646
public static DateValue getInstance(Date date) {
        DateValue result;
        if (date != null) {
            synchronized (cache) {
                result = cache.get(date);
                if (result == null) {
                    result = new DateValue(date);
                    cache.put(date, result);
                }
            }
        } else {
            result = getInstance(new Date());
        }
        return result;
    }
1139478
public static Date toUtcDate(TimeZone browserTZ, TimeZone targetTZ, Date localDate) {
        if (localDate == null) {
            return null;
        }

        long local = localDate.getTime();
        int targetOffsetFromUTC = targetTZ.getOffset(local);
        int browserOffsetFromUTC = browserTZ.getOffset(local);

        return new Date(local - targetOffsetFromUTC + browserOffsetFromUTC);
    }
442937
public static int compare(Date left, double right) {
	return compare(left.getTime() / 1000, DateTimeUtil.getInstance().toDateTime(right).getTime() / 1000);
    }
494100
public static Date getDateOfMinutesBack(final int minutesBack, final Date date) {

    return dateBack(Calendar.MINUTE, minutesBack, date);
  }
73377
public TaskAddOptions withOcpDate(DateTime ocpDate) {
        if (ocpDate == null) {
            this.ocpDate = null;
        } else {
            this.ocpDate = new DateTimeRfc1123(ocpDate);
        }
        return this;
    }
359875
public static Date getDayStartDate(Date date)
   {
      if (date != null)
      {
         Calendar cal = popCalendar(date);
         cal.set(Calendar.HOUR_OF_DAY, 0);
         cal.set(Calendar.MINUTE, 0);
         cal.set(Calendar.SECOND, 0);
         cal.set(Calendar.MILLISECOND, 0);
         date = cal.getTime();
         pushCalendar(cal);
      }
      return (date);
   }
1221165
public boolean inGivenDay(Date theGivenDate) {
		Date[] givenDay = of(theGivenDate).asDayRange();
		return this.target.compareTo(givenDay[0]) >= 0 && this.target.compareTo(givenDay[1]) <= 0;
	}
1100580
public Calendar getCalendar(final Date min, final Date max) {
		long millis = getLong(min.getTime(), max.getTime());
		return createCalendar(millis);
	}
681694
function(date, dateTo) {

        if ( dateTo instanceof Date) {
            // The number of milliseconds in one day
            var oneDay = 1000 * 60 * 60 * 24

            // Convert both dates to milliseconds
            var date1Ms = date.getTime()
            var date2Ms = dateTo.getTime()

            // Calculate the difference in milliseconds
            var count = Math.abs(date1Ms - date2Ms)

            // Convert back to days and return
            return Math.round(count/oneDay);
        } else {
            throw new Error('dateTo is not instance of Date() !')
        }
    }
1214026
public static Date getInstance(final java.util.Date date, final Value type) {
        if (Value.DATE.equals(type)) {
            return new Date(date);
        }
        return new DateTime(date);
    }
1021003
public static Date substractDaysFromDate(final Date date, final int substractDays)
	{
		final Calendar dateOnCalendar = Calendar.getInstance();
		dateOnCalendar.setTime(date);
		dateOnCalendar.add(Calendar.DATE, substractDays * -1);
		return dateOnCalendar.getTime();
	}
899368
public static long getMillisDifference(Date startDate, Date endDate) {
		long startTime = startDate.getTime();
		long endTime = endDate.getTime();
		long diffTime = endTime - startTime;
		return diffTime;
	}
1134744
public static java.sql.Date getSqlDate(java.util.Date date) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        return new java.sql.Date(cal.getTimeInMillis());
    }
622880
private int compareDate(Date a, Date b) {
		final Date ta = new Date(a.getTime());
		final Date tb = new Date(b.getTime());
		final long d1 = setHourToZero(ta).getTime();
		final long d2 = setHourToZero(tb).getTime();
		return (int) Math.round((d2 - d1) / 1000.0 / 60.0 / 60.0 / 24.0);
	}
162453
private Date adjustDate(final Date date) {
        
        if(!isDateStart1904() && date.getTime() < ExcelDateUtils.MILLISECONDS_19000101) {
            return new Date(date.getTime() + TimeUnit.DAYS.toMillis(1));
        }
        
        return date;
    }
20097
public static <T extends Comparable<?>> DateOperation<T> dateOperation(Class<? extends T> type,
            Operator operator, Expression<?>... args) {
        return new DateOperation<T>(type, operator, args);
    }