10 private final LocalDateTime localDateTime;
11 private final ZoneOffset zoneOffset;
13 public NZonedDateTime(LocalDateTime localDateTime, ZoneOffset zoneOffset) {
14 this.localDateTime = localDateTime;
15 this.zoneOffset = zoneOffset;
22 return localDateTime.getYear();
29 return localDateTime.getMonth().getValue();
36 return localDateTime.getDayOfMonth();
43 return localDateTime.getHour();
50 return localDateTime.getMinute();
57 return localDateTime.getSecond();
64 return localDateTime.getNano() / 1000;
71 return zoneOffset.getTotalSeconds();
75 public String toString() {
76 return String.format(
"%d-%02d-%02dT%02d:%02d:%02d.%06d%s",
83 public boolean equals(Object o) {
87 if (o ==
null || getClass() != o.getClass()) {
90 NZonedDateTime that = (NZonedDateTime) o;
91 return getYear() == that.getYear()
93 &&
getDay() == that.getDay()
102 public int hashCode() {
103 return Objects.hash(localDateTime,
getOffset());