Here you can find the source of getCurrentHours()
public static int getCurrentHours()
//package com.java2s; /*L// w w w. ja v a 2 s .com * Copyright Georgetown University, Washington University. * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/cab2b/LICENSE.txt for details. */ import java.util.Calendar; public class Main { public static int getCurrentHours() { return Calendar.getInstance().get(Calendar.HOUR); } }