Java Hour getHour(Date date)

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

Description

get Hour

License

Open Source License

Declaration

public static final int getHour(Date date) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    public static final int getHour(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);/*from  www. j  ava 2 s  . c  o  m*/
        return calendar.get(11);
    }

    public static final int getHour(long millis) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(millis);
        return calendar.get(11);
    }
}

Related

  1. getHour(Date date)
  2. getHour(Date date)
  3. getHour(Date date)
  4. getHour(Date date)
  5. getHour(Date date)
  6. getHour(Date date)
  7. getHour(Date now)
  8. getHour(final Date timeFrom)
  9. getHour(java.util.Date date)