List of utility methods to do Day From
Date | calculateDate(Date startDay, int days) calculate Date Calendar cal = Calendar.getInstance();
cal.setTime(startDay);
cal.add(Calendar.DAY_OF_YEAR, days);
return cal.getTime();
|
long | calculatorStartTimeOnDay(Date date) calculator Start Time On Day Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
return cal.getTimeInMillis();
|
long | clearDay(long timeInMillis) clear Day Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(timeInMillis);
cal.set(Calendar.MILLISECOND, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.HOUR_OF_DAY, 0);
return cal.getTimeInMillis();
|
boolean | CompareDay(Date orgin, Date target) Compare Day long interval = target.getTime() - orgin.getTime(); return (int) (interval / (24 * 60 * 60 * 1000)) < OneDay; |
Date | convertYYMMDDToDate(int y, int m, int d, boolean beginning_of_day) convert YYMMDD To Date if (m < 0 || m > 11) m = 0; if (d < 0 || d > 30) d = 0; GregorianCalendar c = new GregorianCalendar(); c.set(Calendar.YEAR, y); c.set(Calendar.MONTH, m); c.set(Calendar.DATE, d); ... |
Date | createInDays(final Date from, final int amount) create In Days final Calendar cal = Calendar.getInstance(); cal.setTime(from); cal.add(Calendar.DATE, amount); return cal.getTime(); |
Integer | day(Integer time) day int day = (int) Math.floor(time / 86400); return day; |
int | dayFromDateValue(long x) Get the day of month from a date value. return (int) (x & 31); |
long | dayNumberToTimestamp(short dateNumber) day Number To Timestamp return dateNumber * (1000L * 60 * 60 * 24);
|
int | days(int d) days return d * hours(24);
|