Java Millisecond Convert toMilliseconds(long seconds, long nanos)

Here you can find the source of toMilliseconds(long seconds, long nanos)

Description

to Milliseconds

License

Open Source License

Declaration

public static long toMilliseconds(long seconds, long nanos) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2009  Clark N. Hobbie/*from  w w w.jav a 2s  .  c  o m*/
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Clark N. Hobbie - initial API and implementation
 *******************************************************************************/

public class Main {
    public static long toMilliseconds(long seconds, long nanos) {
        long result = seconds * 1000;
        result += nanos / 1000000;
        long temp = nanos % 1000000;
        if (temp > 0)
            result++;

        return result;
    }
}

Related

  1. toMillis(long nanos)
  2. toMilliSeconds(float t)
  3. toMilliseconds(long nanoSeconds)
  4. toMilliseconds(long nanoseconds)
  5. toMilliseconds(long second)
  6. toMilliseconds(Object value)
  7. toMillisFromNanos(long nanos)
  8. toMillisInfo(long ms)
  9. toMillisToDayTime(long mill)