Here you can find the source of getHour()
public static double getHour()
//package com.java2s; //License from project: Open Source License import java.text.DecimalFormat; public class Main { private static long timer = 0; private static DecimalFormat formatter = new DecimalFormat("#.##"); public static double getHour() { return format(getMinute() / 60.0); }//from w w w. jav a2s . co m private static Double format(double val) { return Double.parseDouble(formatter.format(val)); } public static double getMinute() { return format(getSecond() / 60.0); } public static double getSecond() { return format((double) getMili() / 1000.0); } public static long getMili() { return timer / 1000000; } }