List of utility methods to do Calendar Time
long | toUnixTime(Calendar timestamp) Convert from a Java Calendar instance into a Unix Time stamp. return timestamp.getTimeInMillis() / 1000L;
|
void | toVonTime(final Calendar cal) to Von Time cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); |
Calendar | unixToCalendar(long unixTime) Converts Unix time to Calendar instance. Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(unixTime);
return calendar;
|
Calendar | zeroTime(Calendar cal) zero Time cal.set(Calendar.HOUR, 0);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
return cal;
|
void | zeroTimeFields(Calendar cal) sets hours/minutes/seconds/milliseconds to 0 cal.set(Calendar.HOUR, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); cal.getTimeInMillis(); |