List of utility methods to do Day Of Year
int | daysInYear(int yearInteger) Answer number of days in given year, accounting for leap yearsTo. return 365 + leapYearBalance(yearInteger);
|
String | firstdayofyear() firstdayofyear SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); String year = sdf.format(new java.util.Date()); return year + "-01-01"; |
int | getDayFromYear(String year) get Day From Year SimpleDateFormat format = new SimpleDateFormat(year_format); Date date; int day = 0; try { date = format.parse(year); Calendar calendar = new GregorianCalendar(); calendar.setTime(date); day = calendar.getActualMaximum(Calendar.DAY_OF_YEAR); ... |
int | getDaysInYear(final int year) Returns the number of days in the year if (isLeapYear(year)) { return DAYS_PER_YEAR + 1; return DAYS_PER_YEAR; |
int | getDaysInYear(int year) get Days In Year return ((year % 4) == 0) ? 366 : 365;
|
int | getDaysInYear(int year) get Days In Year if (year > 1582) { if (year % 400 == 0) return 366; else if (year % 100 == 0) return 365; else if (year % 4 == 0) return 366; else ... |
int | getDaysOfYear(int year) get Days Of Year if (isBissextile(year)) { return 366; return 365; |
long | getEndTimeOfYear(int year) get End Time Of Year Calendar cal = Calendar.getInstance();
cal.set(year + 1, Calendar.JANUARY, 1, 23, 59, 59);
return cal.getTimeInMillis() - 24 * 60 * 60 * 1000;
|
Date | getFirstDayOfTheYear(int year) get First Day Of The Year Calendar firstDayOfThisYear = Calendar.getInstance();
firstDayOfThisYear.clear();
firstDayOfThisYear.set(Calendar.YEAR, year);
firstDayOfThisYear.set(Calendar.DAY_OF_YEAR, 1);
return firstDayOfThisYear.getTime();
|
Date | getFirstDayOfYear(int year) get First Day Of Year return getFirstDayOfQuarter(year, 1);
|