Java Hour getHour()

Here you can find the source of getHour()

Description

get Hour

License

Apache License

Declaration

public static String getHour() 

Method Source Code

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

import java.text.SimpleDateFormat;

import java.util.Date;

public class Main {
    public final static SimpleDateFormat sdf = new SimpleDateFormat();

    public static String getHour() {
        sdf.applyPattern("HH");
        return sdf.format(new Date());
    }/*from  w  w  w .  jav  a  2 s .c om*/
}

Related

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