Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Java Program to convert this duration to the total length in milliseconds

import java.time.Duration;
public class Demo {
	public static void main(String[] args) {
		Duration d1 =  Duration.ofDays(20);
		Duration d2 =  Duration.ofHours(100);
		Duration d3 =  Duration.ofMinutes(150);
		System.out.println("Milliseconds in 20 days = "+d1.toMillis());
		System.out.println("Milliseconds in 100 hours = "+d2.toMillis());
		System.out.println("Milliseconds in 150 minutes = "+d3.toMillis());
	}
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.