/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.time.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
LocalTime lt = LocalTime.parse ( input );
Duration d = Duration.between ( LocalTime.MIN , lt );
System.
out.
println( "input: " + input
); System.
out.
println ( "d.toString(): " + d
);
ArrayList<Duration> durations = new ArrayList<>( 3 ); // Initial capacity of 3 elements.
durations.add( d ) ;
durations.add( Duration.between ( LocalTime.MIN , LocalTime.parse ( "03:00:00" ) ) ) ;
durations.add( Duration.between ( LocalTime.MIN , LocalTime.parse ( "01:15:00" ) ) ) ;
System.
out.
println( "durations.toString(): " + durations
);
// You can parse as well as generate standard ISO 8601 strings for duration.
Duration dParsed = Duration.parse( "PT8H30M" );
System.
out.
println( "dParsed.toString(): " + dParsed
);
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgppbXBvcnQgamF2YS50aW1lLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoKICAgICAgICBTdHJpbmcgaW5wdXQgPSAiMDg6MzA6MDAiIDsKICAgICAgICBMb2NhbFRpbWUgbHQgPSBMb2NhbFRpbWUucGFyc2UgKCBpbnB1dCApOwogICAgICAgIER1cmF0aW9uIGQgPSBEdXJhdGlvbi5iZXR3ZWVuICggTG9jYWxUaW1lLk1JTiAsIGx0ICk7CgogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbiggImlucHV0OiAiICsgaW5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