Android Utililty Methods Date Trim

List of utility methods to do Date Trim

Description

The list of methods to do Date Trim are organized into topic(s).

Method

DateconvertToShortDate(Date date)
convert To Short Date
if (date == null) {
    return null;
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
...
DateconvertToShortHour(Date date)
convert To Short Hour
if (date == null) {
    return null;
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
...
DateconvertToShortMonth(Date date)
convert To Short Month
if (date == null) {
    return null;
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.DAY_OF_MONTH, 1);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
...
DateconvertToShortWeek(Date date)
convert To Short Week
if (date == null) {
    return null;
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
...
DateconvertToShortYear(Date date)
convert To Short Year
if (date == null) {
    return null;
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.MONTH, Calendar.JANUARY);
calendar.set(Calendar.DAY_OF_MONTH, 1);
calendar.set(Calendar.HOUR_OF_DAY, 0);
...