Java Date Start getStartDateOfCurrentSemester()

Here you can find the source of getStartDateOfCurrentSemester()

Description

get Start Date Of Current Semester

License

Open Source License

Declaration

private static Date getStartDateOfCurrentSemester() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    private static Date getStartDateOfCurrentSemester() {
        Calendar cal = Calendar.getInstance();
        int month = cal.get(Calendar.MONTH);
        int year = cal.get(Calendar.YEAR);
        if (month >= 9 && month <= 2) {
            // Oct 01 00:00:00 CEST year
            cal.set(year, Calendar.OCTOBER, 1, 0, 0, 0);
            return cal.getTime();
        } else {/* w w w  .j  ava 2 s  . c  o m*/
            // Apr 01 00:00:00 CEST year
            cal.set(year, Calendar.APRIL, 1, 0, 0, 0);
            return cal.getTime();
        }
    }
}

Related

  1. getStart(Date date)
  2. getStartDate(Date date)
  3. getStartDate(Date date)
  4. getStartDate(Date date)
  5. getStartDate(String date)
  6. getStartDateOfCurrMonth()
  7. getStartDay(Date date)
  8. getStartDayOfNextMonth(Date date)
  9. getStartOfDate(final Date date)