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.*;

public class Main {

    public static String getHour() {
        Date currentTime = new Date();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String dateString = formatter.format(currentTime);
        String hour;//  ww  w.  j a v  a 2s .co  m
        hour = dateString.substring(11, 13);
        return hour;
    }
}

Related

  1. getCurrHour()
  2. getDelay(int hour, int min)
  3. getDelayToNextHour(int amount, boolean skipNext)
  4. getGMTHour(int localHour)
  5. getHexString(byte[] raw)
  6. getHour()
  7. getHour()
  8. getHour()
  9. getHour()