Online Java Compiler By
JavaTpoint.com
import java.util.Date; public class JavaDateGetHoursExample1 { public static void main(String[] args) { Date d=new Date(); System.out.println("Hour of the day is : "+d.getHours()); } }
Output