/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.time.*;
import java.time.format.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
Instant instant = Instant.now() ; // Current moment in UTC.
OffsetDateTime odt = instant.atOffset( ZoneOffset.UTC ) ; // A wrapper around Instant, more flexible such as formatting.
DateTimeFormatter f = DateTimeFormatter.RFC_1123_DATE_TIME ;
String output
= odt.
format( f
) ;
System.
out.
println( "instant.toString(): " + instant
); System.
out.
println( "odt.toString(): " + odt
); System.
out.
println( "output: " + output
); }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnRpbWUuKjsKaW1wb3J0IGphdmEudGltZS5mb3JtYXQuKjsKCi8qIE5hbWUgb2YgdGhlIGNsYXNzIGhhcyB0byBiZSAiTWFpbiIgb25seSBpZiB0aGUgY2xhc3MgaXMgcHVibGljLiAqLwpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJSW5zdGFudCBpbnN0YW50ID0gSW5zdGFudC5ub3coKSA7IC8vIEN1cnJlbnQgbW9tZW50IGluIFVUQy4KCQlPZmZzZXREYXRlVGltZSBvZHQgPSBpbnN0YW50LmF0T2Zmc2V0KCBab25lT2Zmc2V0LlVUQyApIDsgLy8gQSB3cmFwcGVyIGFyb3VuZCBJbnN0YW50LCBtb3JlIGZsZXhpYmxlIHN1Y2ggYXMgZm9ybWF0dGluZy4KCQlEYXRlVGltZUZvcm1hdHRlciBmID0gRGF0ZVRpbWVGb3JtYXR0ZXIuUkZDXzExMjNfREFURV9USU1FIDsKCQlTdHJpbmcgb3V0cHV0ID0gb2R0LmZvcm1hdCggZiApIDsKCQkKCQlTeXN0ZW0ub3V0LnByaW50bG4oICJpbnN0YW50LnRvU3RyaW5nKCk6ICIgKyBpbnN0YW50ICk7CgkJU3lzdGVtLm91dC5wcmludGxuKCAib2R0LnRvU3RyaW5nKCk6ICIgKyBvZHQgKTsKCQlTeXN0ZW0ub3V0LnByaW50bG4oICJvdXRwdXQ6ICIgKyBvdXRwdXQgKTsKCX0KfQ==