Here you can find the source of toMillis(Double sourceValue, TimeUnit sourceUnit)
public static Double toMillis(Double sourceValue, TimeUnit sourceUnit)
//package com.java2s; //License from project: Open Source License import java.util.concurrent.TimeUnit; public class Main { public static Double toMillis(Double sourceValue, TimeUnit sourceUnit) { if (sourceUnit == null || sourceValue == null) { return null; }/* w w w . j av a 2 s .c om*/ switch (sourceUnit) { case DAYS: return sourceValue * 86400000; case MICROSECONDS: return sourceValue * 0.001; case HOURS: return sourceValue * 3600000; case MILLISECONDS: return sourceValue; case MINUTES: return sourceValue * 60000; case NANOSECONDS: return sourceValue * 1.0e-6; case SECONDS: return sourceValue * 1000; default: return sourceValue; } } }