Here you can find the source of timeToMs(int day, int hour, int min, int sec)
Parameter | Description |
---|---|
day | day |
hour | hour |
min | min |
sec | sec |
public static long timeToMs(int day, int hour, int min, int sec)
//package com.java2s; //License from project: Apache License public class Main { private static final int CONSTANT_24 = 24; private static final int CONSTANT_60 = 60; private static final int CONSTANT_1000 = 1000; /**/*from w w w . j a v a2 s .c om*/ * Convert time to millisecond. * * @param day * day * @param hour * hour * @param min * min * @param sec * sec * @return converted millisecond */ public static long timeToMs(int day, int hour, int min, int sec) { return ((long) CONSTANT_1000) * (((day * CONSTANT_24 + hour) * CONSTANT_60 + min) * CONSTANT_60 + sec); } }