Java Hour getHour()

Here you can find the source of getHour()

Description

Get the current hour

License

LGPL

Return

The current hour

Declaration

public static String getHour() 

Method Source Code


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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    /**/*from   w  w w .j  av  a  2 s.  c o  m*/
     * Get the current hour
     * @return The current hour
     */
    public static String getHour() {
        Date date = new Date();
        SimpleDateFormat format = new SimpleDateFormat("HH");
        String output = format.format(date);
        return output;
    }
}

Related

  1. getHour()
  2. getHour()
  3. getHour()
  4. getHour()
  5. getHour()
  6. getHour()
  7. getHour()
  8. getHour()
  9. getHour()