Java Time Convert to timeToMs(int day, int hour, int min, int sec)

Here you can find the source of timeToMs(int day, int hour, int min, int sec)

Description

Convert time to millisecond.

License

Apache License

Parameter

Parameter Description
day day
hour hour
min min
sec sec

Return

converted millisecond

Declaration

public static long timeToMs(int day, int hour, int min, int sec) 

Method Source Code

//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);
    }
}

Related

  1. timeToFromNow(long time)
  2. timeToIndex(String twentyFourHourTime)
  3. timeToInt(final String time)
  4. timeToJgo(long milliSeconds)
  5. timeToLong(String inputStr)
  6. timeToRad(int time)
  7. timeToTick(float time, float speed)
  8. timeToTicks(Long time)
  9. timeToTimestamp(long currentTimeMsecs)