Java Utililty Methods Hour

List of utility methods to do Hour

Description

The list of methods to do Hour are organized into topic(s).

Method

doublegetHour()
get Hour
return format(getMinute() / 60.0);
StringgetHour()
get Hour
Date date = new Date();
SimpleDateFormat formatter;
String pattern = "HH";
formatter = new SimpleDateFormat(pattern, new Locale("ko", "KOREA"));
return formatter.format(date);
StringgetHour()
Devuelve la hora actual
return new SimpleDateFormat("HH:mm:ss").format(Calendar.getInstance().getTime());
StringgetHour()
Get the current hour
Date date = new Date();
SimpleDateFormat format = new SimpleDateFormat("HH");
String output = format.format(date);
return output;
StringgetHour()
get Hour
sdf.applyPattern("HH");
return sdf.format(new Date());
intgetHour()
get Hour
Calendar calendar = new GregorianCalendar();
Date trialtime = new Date();
calendar.setTime(trialtime);
return calendar.get(Calendar.HOUR);
StringgetHour()
get Hour
Date currentTime = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateString = formatter.format(currentTime);
String hour;
hour = dateString.substring(11, 13);
return hour;
IntegergetHour()
get Hour
return getHour(null);
StringgetHour(boolean military)
Returns the current hour as a string.
if (mCalendar == null)
    Init();
String retVal = null;
int val = mCalendar.get(Calendar.HOUR_OF_DAY);
if (military) {
    if (val < 10)
        retVal = "0" + val;
    else
...
intgetHour(Date begin, Date end)
get Hour
Calendar c1 = Calendar.getInstance();
c1.setTime(begin);
Calendar c2 = Calendar.getInstance();
c2.setTime(end);
Long millisecond = c2.getTimeInMillis() - c1.getTimeInMillis();
Long hour = millisecond / 1000 / 60 / 60;
Long minute = (millisecond / 1000 / 60) % 60;
if (minute >= 30) {
...