This method returns the value of the specified field. If the provided TemporalField is not supported, UnsupportedTemporalTypeException is thrown.
  

package com.logicbig.example.zoneddatetime;
import java.time.DateTimeException;
import java.time.ZonedDateTime;
import java.time.temporal.ChronoField;
import java.time.temporal.UnsupportedTemporalTypeException;
public class GetExample {
    public static void main(String... args) {
        ZonedDateTime d = ZonedDateTime.now();
        for (ChronoField chronoField : ChronoField.values()) {
            try {
                int i = d.get(chronoField);
                System.out.printf("%30s: %s%n", chronoField.name(), i);
            } catch (UnsupportedTemporalTypeException e) {
                System.out.printf("%30s: %s%n", chronoField.name(), e.getMessage());
            }
        }
    }
}
Output
                NANO_OF_SECOND: 619000000
                   NANO_OF_DAY: Invalid field 'NanoOfDay' for get() method, use getLong() instead
               MICRO_OF_SECOND: 619000
                  MICRO_OF_DAY: Invalid field 'MicroOfDay' for get() method, use getLong() instead
               MILLI_OF_SECOND: 619
                  MILLI_OF_DAY: 73276619
              SECOND_OF_MINUTE: 16
                 SECOND_OF_DAY: 73276
                MINUTE_OF_HOUR: 21
                 MINUTE_OF_DAY: 1221
                  HOUR_OF_AMPM: 8
            CLOCK_HOUR_OF_AMPM: 8
                   HOUR_OF_DAY: 20
             CLOCK_HOUR_OF_DAY: 20
                   AMPM_OF_DAY: 1
                   DAY_OF_WEEK: 3
  ALIGNED_DAY_OF_WEEK_IN_MONTH: 1
   ALIGNED_DAY_OF_WEEK_IN_YEAR: 1
                  DAY_OF_MONTH: 29
                   DAY_OF_YEAR: 302
                     EPOCH_DAY: Invalid field 'EpochDay' for get() method, use getLong() instead
         ALIGNED_WEEK_OF_MONTH: 5
          ALIGNED_WEEK_OF_YEAR: 44
                 MONTH_OF_YEAR: 10
               PROLEPTIC_MONTH: Invalid field 'ProlepticMonth' for get() method, use getLong() instead
                   YEAR_OF_ERA: 2025
                          YEAR: 2025
                           ERA: 1
               INSTANT_SECONDS: Invalid field 'InstantSeconds' for get() method, use getLong() instead
                OFFSET_SECONDS: 28800