Java Calendar Millisecond getLastMilli(Calendar cal)

Here you can find the source of getLastMilli(Calendar cal)

Description

Returns the last millisecond of the given day the day (2008/03/07 15:23:32 992ms --> 2008/03/07 23:59:59 999ms)

License

Apache License

Parameter

Parameter Description
cal a parameter

Declaration

public static Calendar getLastMilli(Calendar cal) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;

import java.util.GregorianCalendar;

public class Main {
    /**/*w  w  w  .j a va2 s .c  o m*/
     * Returns the last millisecond of the given day  
     * the day (2008/03/07 15:23:32 992ms --> 2008/03/07 23:59:59 999ms)
     * @param cal
     * @return 
     */
    public static Calendar getLastMilli(Calendar cal) {
        Calendar ret = new GregorianCalendar(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH),
                cal.get(Calendar.DAY_OF_MONTH), 23, 59, 59);
        ret.set(Calendar.MILLISECOND, 999);
        return ret;
    }
}

Related

  1. calendarToGMTMillis(Calendar cal)
  2. clearCalendarMillisecond(Calendar cal)
  3. elapsedMillis(Calendar before, Calendar after)
  4. getCalendarXDaysFromY(long startTimeInMillis, int daysFromStartDate)
  5. getDateMilliseconds(Calendar pDate)
  6. getMillisecond(Calendar calendar)
  7. getMilliSinceMidnight(Calendar arg)
  8. hasZeroMilliSeconds(Calendar cal)
  9. newCalendar(long timeInMillis)