/* 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 inputGood
= "2015-07-30T09:32:05.543+02:00" ; String inputBad
= "2015-07-35T09:32:05.543+02:00" ;
try {
// Good
OffsetDateTime odtGood = OffsetDateTime.parse ( inputGood ) ;
System .
out .
println ( "odtGood.toString(): " + odtGood
) ;
// Bad
OffsetDateTime odtBad = OffsetDateTime.parse ( inputBad ) ;
System .
out .
println ( "odtBad.toString(): " + odtBad
) ; } catch ( DateTimeParseException e ) {
}
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgppbXBvcnQgamF2YS50aW1lLiogOwppbXBvcnQgamF2YS50aW1lLmZvcm1hdC4qIDsKCi8qIE5hbWUgb2YgdGhlIGNsYXNzIGhhcyB0byBiZSAiTWFpbiIgb25seSBpZiB0aGUgY2xhc3MgaXMgcHVibGljLiAqLwpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgoJCVN0cmluZyBpbnB1dEdvb2QgPSAiMjAxNS0wNy0zMFQwOTozMjowNS41NDMrMDI6MDAiIDsKCQlTdHJpbmcgaW5wdXRCYWQgPSAiMjAxNS0wNy0zNVQwOTozMjowNS41NDMrMDI6MDAiIDsKCgkJdHJ5eyAKCQkJLy8gR29vZAoJCQlPZmZzZXREYXRlVGltZSBvZHRHb29kID0gT2Zmc2V0RGF0ZVRpbWUucGFyc2UoIGlucHV0R29vZCApIDsKCQkJU3lzdGVtLm91dC5wcmludGxuKCAib2R0R29vZC50b1N0cmluZygpOiAiICsgb2R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