Java Day End getTrendTime(Date date)

Here you can find the source of getTrendTime(Date date)

Description

get Trend Time

License

Apache License

Declaration

public static Date[][] getTrendTime(Date date) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static Date[][] getTrendTime(Date date) {
        Date[][] dates = new Date[6][2];
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);/*from ww  w  . j a v a2s  .  c om*/
        calendar.set(Calendar.DAY_OF_MONTH, 0);
        dates[5][1] = calendar.getTime();
        calendar.set(Calendar.DAY_OF_MONTH, 1);
        dates[5][0] = calendar.getTime();

        calendar.set(Calendar.DAY_OF_MONTH, 0);
        dates[4][1] = calendar.getTime();
        calendar.set(Calendar.DAY_OF_MONTH, 1);
        dates[4][0] = calendar.getTime();

        calendar.set(Calendar.DAY_OF_MONTH, 0);
        dates[3][1] = calendar.getTime();
        calendar.set(Calendar.DAY_OF_MONTH, 1);
        dates[3][0] = calendar.getTime();

        calendar.set(Calendar.DAY_OF_MONTH, 0);
        dates[2][1] = calendar.getTime();
        calendar.set(Calendar.DAY_OF_MONTH, 1);
        dates[2][0] = calendar.getTime();

        calendar.set(Calendar.DAY_OF_MONTH, 0);
        dates[1][1] = calendar.getTime();
        calendar.set(Calendar.DAY_OF_MONTH, 1);
        dates[1][0] = calendar.getTime();

        calendar.set(Calendar.DAY_OF_MONTH, 0);
        dates[0][1] = calendar.getTime();
        calendar.set(Calendar.DAY_OF_MONTH, 1);
        dates[0][0] = calendar.getTime();
        return dates;
    }
}

Related

  1. getSubSeconds(Date minuendDate, Date subDate)
  2. getTimeBeetweenDates(Date d1, Date d2, int timeType)
  3. getTimeInterval(Date startDate, Date endDate)
  4. getTotalDays(Date startDate, Date endDate)
  5. getTotalMonths(final Date startDateToCheck, final Date endDateToCheck)
  6. getWorkingDays(Calendar start, Calendar end, final Long[] holidays)
  7. getWorkingDaysBetweenTwoDates(Date startDate, Date endDate)
  8. getYearsBetween(Date startDate, Date endDate)
  9. getYearsBetweenDate(Date begin, Date end)