/* 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
{
{
String input
= "Mon Mar 14 16:02:37 GMT 2011"; DateTimeFormatter f = DateTimeFormatter.ofPattern( "E MMM d HH:mm:ss z uuuu" );
ZonedDateTime zdt = ZonedDateTime.parse( input , f );
YearMonth ym = YearMonth.from( zdt );
int year = ym.getYear();
int month = ym.getMonthValue();
System.
out.
println( "input: " + input
); System.
out.
println( "zdt: " + zdt
); System.
out.
println( "ym: " + ym
); }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnRpbWUuKjsKaW1wb3J0IGphdmEudGltZS5mb3JtYXQuKjsKCi8qIE5hbWUgb2YgdGhlIGNsYXNzIGhhcyB0byBiZSAiTWFpbiIgb25seSBpZiB0aGUgY2xhc3MgaXMgcHVibGljLiAqLwpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CiAgICAgICAgU3RyaW5nIGlucHV0ID0gIk1vbiBNYXIgMTQgMTY6MDI6MzcgR01UIDIwMTEiOwogICAgICAgIERhdGVUaW1lRm9ybWF0dGVyIGYgPSBEYXRlVGltZUZvcm1hdHRlci5vZlBhdHRlcm4oICJFIE1NTSBkIEhIOm1tOnNzIHogdXV1dSIgKTsKICAgICAgICBab25lZERhdGVUaW1lIHpkdCA9IFpvbmVkRGF0ZVRpbWUucGFyc2UoIGlucHV0ICwgZiApOwogICAgICAgIFllYXJNb250aCB5bSA9IFllYXJNb250aC5mcm9tKCB6ZHQgKTsKICAgICAgICBpbnQgeWVhciA9IHltLmdldFllYXIoKTsKICAgICAgICBpbnQgbW9udGggPSB5bS5nZXRNb250aFZhbHVlKCk7CiAgICAgICAgCiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKCAiaW5wdXQ6ICIgKyBpbnB1dCApOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbiggInpkdDogIiArIHpkdCApOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbiggInltOiAiICsgeW0gKTsKCX0KfQ==