Java Hour getHour(Date d)

Here you can find the source of getHour(Date d)

Description

get Hour

License

Artistic License

Declaration

public static int getHour(Date d) 

Method Source Code

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

import java.util.Calendar;
import java.util.Date;

public class Main {
    public static int getHour(Date d) {
        return get(d, Calendar.HOUR_OF_DAY);
    }//from   ww w.j  a  va2 s. co m

    private static int get(Date d, int field) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(d);
        return cal.get(field);
    }
}

Related

  1. getHour()
  2. getHour(boolean military)
  3. getHour(Date begin, Date end)
  4. getHour(Date d)
  5. getHour(Date d)
  6. getHour(Date date)
  7. getHour(Date date)
  8. getHour(Date date)
  9. getHour(Date date)