Java Millisecond to Hour getMillisFromHours(String hours)

Here you can find the source of getMillisFromHours(String hours)

Description

get Millis From Hours

License

Open Source License

Declaration

public static long getMillisFromHours(String hours) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static long getMillisFromHours(String hours) {
        try {//from   w ww  . j  a  va2s  .c om
            double numHours = Double.parseDouble(hours);
            double millisDouble = (numHours * 3600 * 1000);
            return (long) millisDouble;
        } catch (NumberFormatException e) {
            return 0;
        }
    }
}

Related

  1. getHoursFromMillis(long ms)
  2. getHoursIntoMilliseconds(int nbHours)
  3. getHourSpareFromMilliSecond(int milliSecond)
  4. getMilliSecondByHourAndMins(int hour, int min)
  5. getMillisFromHours(String hours)
  6. milliseconds(long p_days, long p_hours, long p_minutes, long p_hoursPerBusinessDay)
  7. millisecondsToHours(long ms)
  8. millisecondToHour(Long millisecond)