/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

import java.time.* ;
import java.time.format.* ;
import java.time.temporal.* ;
import java.util.concurrent.TimeUnit ;


/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Duration d1 = Duration.ofHours( 1 ).plusMinutes( 23 ).plusSeconds( 45 ).plusMillis( 678 );
		String output1 = d1.toString() ;
		long milliseconds = d1.toMillis() ;
		
		System.out.println( "output1: " + output1 ) ;
		System.out.println( "d.toMillis(): " + milliseconds ) ;
		
		//--------------------
		
    	Duration d = Duration.ofMillis( 5_025_678L ) ;
    	String output = d.toHoursPart() + ":" + d.toMinutesPart() + ":" + d.toSecondsPart() + "." + TimeUnit.NANOSECONDS.toMillis( d.toNanosPart() ) ;
    	
    	System.out.println( "output: " + output ) ;
		
		//-------------------
		
		Duration d3 = Duration.ofMillis( 5_025_678L ) ;
        long nanoOfDay = d3.toNanos() ;
        LocalTime localTimeBogus = LocalTime.ofNanoOfDay( nanoOfDay ) ;
        String output3 = localTimeBogus.toString() ;
        
        System.out.println( "output3: " + output3 ) ;
	
	}
}