Java Utililty Methods Minute Calculate

List of utility methods to do Minute Calculate

Description

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

Method

DatesetMinutes(Date date, int amount)
Sets the minute field to a date returning a new object.
return set(date, Calendar.MINUTE, amount);
StringshiftTime(Object o, int minutes)
shift Time
String timestamp = o.toString();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
Date date = null;
if (timestamp != null && timestamp.length() >= 1 && timestamp.substring(0, 1).equals("-")) {
    date = new Date();
    date.setTime(date.getTime() + 60 * 60000);
} else {
    try {
...
StringtoDegreesMinutes(double degrees, int nDecimals, boolean longitude)
to Degrees Minutes
double[] dms = toDegreesMinutes(degrees);
int deg = (int) dms[0];
double min = dms[1];
NumberFormat minutesFormatter = NumberFormat.getInstance();
minutesFormatter.setMinimumFractionDigits(nDecimals);
minutesFormatter.setMaximumFractionDigits(nDecimals);
minutesFormatter.setMinimumIntegerDigits(2);
String hemisphere = longitude ? (degrees >= 0.0 ? "E" : "W") : (degrees >= 0.0 ? "N" : "S");
...
LongtoMinutes(Date fecha)
to Minutes
String sFecha = toTime(fecha);
long horas = Long.parseLong(sFecha.substring(0, 2));
long minutos = Long.parseLong(sFecha.substring(3));
minutos = horas * 60 + minutos;
return minutos;
StringtoMinuteString(long time)
to Minute String
return minutesFormatter.format(time);