List of utility methods to do Day From
int | days(int month, int year) days if (month == 2) return 28 + ((year % 4 == 0) ? 1 : 0) - ((year % 4 == 100) ? 1 : 0); if (month < 8) return 30 + (month % 2); return 31 - (month % 2); |
int | days(int num) days return hours(24 * num);
|
int | days(int year, int month) days int total = 30; switch (month) { case 1: case 3: case 5: case 7: case 8: case 10: ... |
int | daysAfter(Date earlierDate, Date laterDate) days After final Calendar earlier = CALENDAR; final Calendar later = CALENDAR2; if (laterDate.before(earlierDate)) return 0; earlier.setTime(earlierDate); later.setTime(laterDate); int daysLater = later.get(Calendar.DAY_OF_YEAR) - earlier.get(Calendar.DAY_OF_YEAR); for (int year = earlier.get(Calendar.YEAR); year < later.get(Calendar.YEAR); year++) { ... |
Float | daysAndHours(int hours) Converts hours to days and hours. int days, hrs; String s = null; days = Math.abs(hours) / 24; hrs = Math.abs(hours) % 24; if (hrs < 10) s = days + ".0" + hrs; else s = days + "." + hrs; ... |
long | daysBetweenTime(long start, long end) days Between Time if (start > end) { return -1; long term = end - start; return term / (1000 * 60 * 60 * 24); |
int | daysInFebruary(int year) Given integer argument year, returns number of days in February of that year. return (((year % 4 == 0) && ((!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28);
|
int | daysInMonthForYear(int commonMonthIndex, int yearInteger) Answer the number of days in the month named monthName in the year yearInteger. int monthIndex = commonMonthIndex - 1; return DaysInMonth[monthIndex] + ((monthIndex == 1) ? leapYearBalance(yearInteger) : 0); |
int | daysOfTwo(Date date1, Date date2) days Of Two Calendar aCalendar = Calendar.getInstance(); aCalendar.setTime(date1); int day1 = aCalendar.get(Calendar.DAY_OF_YEAR); aCalendar.setTime(date2); int day2 = aCalendar.get(Calendar.DAY_OF_YEAR); return day2 - day1; |
List | daysSince(Date since) days Since List<Date> list = new ArrayList<Date>(); Date today = getMidnight(new Date()); for (Date d = getMidnight(since); d.before(today) || d.equals(today); d = newDateFrom(d, Calendar.DAY_OF_YEAR, 1)) { list.add(d); return list; |