Here you can find the source of _toSeconds(String strTime)
private static Float _toSeconds(String strTime)
//package com.java2s; //License from project: Apache License public class Main { private static Float _toSeconds(String strTime) { Float time = 0F;/*from w w w .j a v a 2 s . c om*/ try { if (strTime.endsWith("s")) { time = Float.parseFloat(strTime.replace("s", "")) * 1; } else if (strTime.endsWith("m")) { time = Float.parseFloat(strTime.replace("m", "")) * 60; } else if (strTime.endsWith("h")) { time = Float.parseFloat(strTime.replace("h", "")) * 60 * 60; } else if (strTime.endsWith("d")) { time = Float.parseFloat(strTime.replace("d", "")) * 60 * 60 * 24; } else time = Float.parseFloat(strTime); } catch (Throwable e) { } return time; } }