Java Hour getHourOfDay(Calendar date)

Here you can find the source of getHourOfDay(Calendar date)

Description

gets the hour-of-day of the given date

License

Open Source License

Declaration

public static String getHourOfDay(Calendar date) 

Method Source Code

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

import java.text.DecimalFormat;

import java.util.Calendar;

public class Main {
    private static DecimalFormat HOUR_FORMATTER = new DecimalFormat("00");

    /**//from   w w w  .  ja  v a 2  s  .com
     * gets the hour-of-day of the given date
     */
    public static String getHourOfDay(Calendar date) {
        String hourOfDay = HOUR_FORMATTER.format(date.get(Calendar.HOUR_OF_DAY));
        return hourOfDay;
    }
}

Related

  1. getHourInt()
  2. getHourMin(Date date)
  3. getHourMinuteSecondByMisSecond(long misSecond)
  4. getHourMinuteString(Date dateTime)
  5. getHourMinuteString(Date t)
  6. getHourOfDay(final Date date)
  7. getHourOfDayInAm(Date dt)
  8. getHourOfWeek(Date dateIn)
  9. getHours()