Java Hour getHour()

Here you can find the source of getHour()

Description

get Hour

License

Apache License

Declaration

public static String getHour() throws ParseException 

Method Source Code

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

import java.text.ParseException;
import java.text.SimpleDateFormat;

import java.util.Date;

import java.util.Locale;

public class Main {

    public static String getHour() throws ParseException {
        Date date = new Date();
        SimpleDateFormat formatter;
        String pattern = "HH";
        formatter = new SimpleDateFormat(pattern, new Locale("ko", "KOREA"));

        return formatter.format(date);
    }//  w ww.  j av  a  2  s  .  c o m
}

Related

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