class TimelineUtilities {

    public static TimeSpan getThisDay(Date time)
    {
        GregorianCalendar cal = new GregorianCalendar();
        cal.setTime(time);

        // Align to the date to day boundaries.
        GregorianCalendar spanCal = new GregorianCalendar(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH),
                cal.get(Calendar.DAY_OF_MONTH));
        long start = spanCal.getTimeInMillis();
        spanCal.add(Calendar.DAY_OF_MONTH, 1);
        long end = spanCal.getTimeInMillis();
        return TimeSpan.get(start, end);
    }

    private  TimelineUtilities();

}