Java Date to Minute minute(final Date date)

Here you can find the source of minute(final Date date)

Description

minute

License

Apache License

Declaration

public static int minute(final Date date) 

Method Source Code


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

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import static java.util.Calendar.*;

public class Main {
    public static int minute(final Date date) {
        return fromDateToCalendar(date).get(MINUTE);
    }/*from w ww  .  jav a  2s .c  om*/

    public static Calendar fromDateToCalendar(final Date date) {
        final Calendar cal = new GregorianCalendar();
        cal.clear();
        cal.setMinimalDaysInFirstWeek(4);
        cal.setFirstDayOfWeek(Calendar.MONDAY);
        cal.setTime(date);

        return cal;
    }
}

Related

  1. getMinutes(Date time)
  2. getMinutes(final Date date)
  3. getMinutesInDay(Date d)
  4. getMinutesOfHour(Date dt)
  5. minute(Date date)
  6. minuteAdd(Date date, int val)
  7. minuteDate(Date date, int num)
  8. minuteOf(Date date)