Java Hour getHours()

Here you can find the source of getHours()

Description

get Hours

License

Apache License

Declaration

public static final int getHours() 

Method Source Code


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

import java.util.Calendar;

public class Main {
    public static final int getHours() {
        return Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
    }/*w w  w. j a  va  2  s  .com*/

    public static final int getHours(long time, boolean wrap) {
        return (int) (wrap ? ((time / 3600000l) % 24) : (time / 3600000l));
    }
}

Related

  1. getHourMinuteString(Date t)
  2. getHourOfDay(Calendar date)
  3. getHourOfDay(final Date date)
  4. getHourOfDayInAm(Date dt)
  5. getHourOfWeek(Date dateIn)
  6. getHours()
  7. getHours(Date t, Date baseDate)
  8. getHours(final Date date)
  9. getHours(java.util.Date _date)