package com.logicbig.example.zoneddatetime;
import java.time.ZonedDateTime;
public class WithYearExample {
public static void main(String... args) {
ZonedDateTime d = ZonedDateTime.now();
System.out.println(d);
ZonedDateTime d2 = d.withYear(2000);
System.out.println(d2);
}
}
Output
2017-05-01T16:00:03.231-05:00[America/Chicago]
2000-05-01T16:00:03.231-05:00[America/Chicago]