Java Utililty Methods Date to Second

List of utility methods to do Date to Second

Description

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

Method

intgetSecond(Date d)
get Second
if (d == null)
    return 0;
final Calendar c = new GregorianCalendar();
c.setTime(d);
return c.get(Calendar.SECOND);
intgetSecond(Date date)
get Second
GregorianCalendar cal = getCalender(date, false);
return cal.get(Calendar.SECOND);
intgetSecond(Date date)
get Second
Calendar c = Calendar.getInstance();
c.setTime(date);
return c.get(Calendar.SECOND);
intgetSecond(Date date)
Return second from a Date .
return getCalendar(date).get(Calendar.SECOND);
intgetSecond(java.util.Date date)
get Second
java.util.Calendar c = java.util.Calendar.getInstance();
c.setTime(date);
return c.get(java.util.Calendar.SECOND);
intgetSecondOfDate(Date date)
get Second Of Date
return getFieldValueByDate(date, Calendar.SECOND);
intgetSecondOfMinute(final Date date)
Get the second within the minute by given date.
E.g.: at 10:04:15.250 PM the SECOND is 15.
return getNumberOfGranularity(Calendar.SECOND, date);
intgetSeconds(Date d)
get Seconds
Calendar c = getCalendar();
c.setTime(d);
return (c.get(Calendar.SECOND));
intgetSeconds(Date dt)
Returns Seconds of the date
Calendar cal = Calendar.getInstance();
cal.setTime(dt);
return cal.get(Calendar.SECOND);
IntegergetSecondsFromDate(Date date)
get Seconds From Date
Integer result = null;
if (date != null) {
    Calendar calendar = Calendar.getInstance();
    calendar.setTime(date);
    result = calendar.get(Calendar.SECOND);
return result;