/* 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.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
String inputStart
= "08:00:12 pm".
toUpperCase() ; String inputStop
= "05:30:12 pm".
toUpperCase() ;
DateTimeFormatter f = DateTimeFormatter.ofPattern( "hh:mm:ss a" );
LocalTime start = LocalTime.parse( inputStart , f );
LocalTime stop = LocalTime.parse( inputStop , f );
Duration d = Duration.between( start , stop );
System.
out.
println( "start.toString(): " + start
); System.
out.
println( "stop.toString(): " + stop
); System.
out.
println( "d.toString(): " + d
);
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgppbXBvcnQgamF2YS50aW1lLio7CmltcG9ydCBqYXZhLnRpbWUuZm9ybWF0Lio7CmltcG9ydCBqYXZhLnRpbWUudGVtcG9yYWwuKjsKCgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoKU3RyaW5nIGlucHV0U3RhcnQgPSAiMDg6MDA6MTIgcG0iLnRvVXBwZXJDYXNlKCkgOwpTdHJpbmcgaW5wdXRTdG9wID0gIjA1OjMwOjEyIHBtIi50b1VwcGVyQ2FzZSgpIDsKCkRhdGVUaW1lRm9ybWF0dGVyIGYgPSBEYXRlVGltZUZvcm1hdHRlci5vZlBhdHRlcm4oICJoaDptbTpzcyBhIiApOwpMb2NhbFRpbWUgc3RhcnQgPSBMb2NhbFRpb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