List of utility methods to do Date Set
Date | setMinute(Date date, int minutes) set Minute return setTime(date, -1, minutes, -1, -1);
|
Date | setMinutes(Date date, int amount) Sets the minute field to a date returning a new object. return set(date, Calendar.MINUTE, amount);
|
Date | setMonths(Date date, int amount) Sets the months field to a date returning a new object. return set(date, Calendar.MONTH, amount);
|
Date | setSeconds(Date date, int amount) Sets the seconds field to a date returning a new object. return set(date, Calendar.SECOND, amount);
|
Date | setTime(Date date, int hour, int minute, int second, int millisecond) set Time Calendar c = Calendar.getInstance(); c.setTime(date); c.set(Calendar.HOUR_OF_DAY, hour >= 0 ? hour : c.get(Calendar.HOUR_OF_DAY)); c.set(Calendar.MINUTE, minute >= 0 ? minute : c.get(Calendar.MINUTE)); c.set(Calendar.SECOND, second >= 0 ? second : c.get(Calendar.SECOND)); ... |
Date | setTime(Date date, int hours, int minutes) set Time return setTime(date, hours, minutes, -1, -1);
|
Date | setTime(Date date, int hours, int minutes, int seconds) set Time return setTime(date, hours, minutes, seconds, -1);
|
Date | setYears(Date date, int amount) Sets the years field to a date returning a new object. return set(date, Calendar.YEAR, amount);
|
String | shortDate(Date date) short Date return format(date, "MM-dd"); |
String | time(Date date) time return format(date, "HH:mm"); |