Makes an spatial shape representing the time range defined by the two specified dates.

@param from the start {@link Date}
@param to the end {@link Date}
@return a shape
1560
public NRShape makeShape(Date from, Date to) {
        UnitNRShape fromShape = tree.toUnitShape(from);
        UnitNRShape toShape = tree.toUnitShape(to);
        return tree.toRangeShape(fromShape, toShape);
    }
1015643
public static DateTime of(Date date) {
		if (date instanceof DateTime) {
			return (DateTime) date;
		}
		return new DateTime(date);
	}
646088
public SearchParams between(final Date start, final Date end) {
        return this.creationGte(start).creationLte(end);
    }
162164
public static long between(Date beginDate, Date endDate, DateUnit unit, boolean isAbs) {
		return new DateBetween(beginDate, endDate, isAbs).between(unit);
	}
1206423
public I withStart(T temporal) {

        IntervalEdge edge = this.start.getEdge();
        Boundary<T> b = Boundary.of(edge, temporal);
        return this.getFactory().between(b, this.end);

    }
699260
public static Duration diff(Date start, Date end) {
		return fromMillis(end.getTime() - start.getTime());
	}
125747
public static final <T extends Date> Function<T, DateTime> dateToDateTime(DateTimeZone dateTimeZone) {
		return new DateToDateTime<T>(dateTimeZone);
	}
820873
public static long betweenMs(Date beginDate, Date endDate) {
		return new DateBetween(beginDate, endDate).between(DateUnit.MS);
	}
286319
public Interval withDates(LocalDate startDate, LocalDate endDate) {
        requireNonNull(startDate);
        requireNonNull(endDate);
        return new Interval(startDate, this.startTime, endDate, this.endTime, this.zoneId);
    }
85687
public void setEndDate(com.google.api.ads.admanager.axis.v201902.Date endDate) {
        this.endDate = endDate;
    }
956877
public static String formatBetween(Date beginDate, Date endDate, BetweenFormater.Level level) {
		return formatBetween(between(beginDate, endDate, DateUnit.MS), level);
	}
433458
public TimerType<T> end(java.util.Date end)
   {
      if (end != null)
      {
         childNode.getOrCreate("end").text(XMLDate.toXMLFormat(end));
         return this;
      }
      return null;
   }
786010
public Date getEnd() {

        if (null != m_explicitEnd) {
            return isWholeDay() ? adjustForWholeDay(m_explicitEnd, true) : m_explicitEnd;
        }
        if ((null == m_end) && (m_series.getInstanceDuration() != null)) {
            m_end = new Date(m_start.getTime() + m_series.getInstanceDuration().longValue());
        }
        return isWholeDay() && !m_series.isWholeDay() ? adjustForWholeDay(m_end, true) : m_end;
    }
1343342
function rangeToSegments(startDate, endDate) {
		var rowCnt = t.getRowCnt();
		var colCnt = t.getColCnt();
		var segments = []; // array of segments to return

		// day offset for given date range
		var rangeDayOffsetStart = dateToDayOffset(startDate);
		var rangeDayOffsetEnd = dateToDayOffset(endDate); // exclusive

		// first and last cell offset for the given date range
		// "last" implies inclusivity
		var rangeCellOffsetFirst = dayOffsetToCellOffset(rangeDayOffsetStart);
		var rangeCellOffsetLast = dayOffsetToCellOffset(rangeDayOffsetEnd) - 1;

		// loop through all the rows in the view
		for (var row=0; row<rowCnt; row++) {

			// first and last cell offset for the row
			var rowCellOffsetFirst = row * colCnt;
			var rowCellOffsetLast = rowCellOffsetFirst + colCnt - 1;

			// get the segment's cell offsets by constraining the range's cell offsets to the bounds of the row
			var segmentCellOffsetFirst = Math.max(rangeCellOffsetFirst, rowCellOffsetFirst);
			var segmentCellOffsetLast = Math.min(rangeCellOffsetLast, rowCellOffsetLast);

			// make sure segment's offsets are valid and in view
			if (segmentCellOffsetFirst <= segmentCellOffsetLast) {

				// translate to cells
				var segmentCellFirst = cellOffsetToCell(segmentCellOffsetFirst);
				var segmentCellLast = cellOffsetToCell(segmentCellOffsetLast);

				// view might be RTL, so order by leftmost column
				var cols = [ segmentCellFirst.col, segmentCellLast.col ].sort();

				// Determine if segment's first/last cell is the beginning/end of the date range.
				// We need to compare "day offset" because "cell offsets" are often ambiguous and
				// can translate to multiple days, and an edge case reveals itself when we the
				// range's first cell is hidden (we don't want isStart to be true).
				var isStart = cellOffsetToDayOffset(segmentCellOffsetFirst) == rangeDayOffsetStart;
				var isEnd = cellOffsetToDayOffset(segmentCellOffsetLast) + 1 == rangeDayOffsetEnd; // +1 for comparing exclusively

				segments.push({
					row: row,
					leftCol: cols[0],
					rightCol: cols[1],
					isStart: isStart,
					isEnd: isEnd
				});
			}
		}

		return segments;
	}
508476
public static LinkedHashSet<String> yearAndQuarter(Date startDate, Date endDate) {
		if (startDate == null || endDate == null) {
			return new LinkedHashSet<String>(0);
		}
		return yearAndQuarter(startDate.getTime(), endDate.getTime());
	}
15317
public static java.sql.Date toSqlDate(java.util.Date date) {
		return new java.sql.Date(date.getTime());
	}
749950
public static Date beginOfWeek(@NotNull final Date date) {
		return DateUtils.truncate(DateUtil.subDays(date, DateUtil.getDayOfWeek(date) - 1), Calendar.DATE);
	}