java get year from calendar variable code example
Example: java get year
import java.time.ZoneId;
import java.util.Date;
new Date().toInstant().atZone(ZoneId.systemDefault()).toLocalDate().getYear();
import java.time.ZoneId;
import java.util.Date;
new Date().toInstant().atZone(ZoneId.systemDefault()).toLocalDate().getYear();