Here you can find the source of timeToDouble(Object value)
public static Double timeToDouble(Object value)
//package com.java2s; //License from project: Apache License public class Main { public static Double timeToDouble(Object value) { Double ret = new Double(0.); if (value != null && value instanceof String) { //PThhHmmMss.sssS try { String duration = (String) value; int length = duration.length(); double hours = 0; double mins = 0; double millisecs = 0.; if (length >= 11) { int hPos = duration.indexOf('H'); int mPos = duration.indexOf('M'); hours = Integer.parseInt(duration.substring(2, hPos)); mins = Integer.parseInt(duration.substring(hPos + 1, mPos)); millisecs = Double.parseDouble(duration.substring(mPos + 1, length - 1)); ret = hours / 24. + mins / 1440. + millisecs / 86400.; }/*from w w w.ja va 2 s . c om*/ } catch (IllegalArgumentException e) { } } return ret; } }