docs: @SuppressWarnings("deprecation")
      public Date toDate() {
          int dom = getDayOfMonth();
          Date date = new Date(getYear() - 1900, getMonthOfYear() - 1, dom);
          LocalDate check = LocalDate.fromDateFields(date);
          if (check.isBefore(this)) {
              // DST gap (no midnight)
              // move forward in units of one hour until date correct
              while (check.equals(this) == false) {
                  date.setTime(date.getTime() + 3600000);
                  check = LocalDate.fromDateFields(date);
              }
              // move back in units of one second until date wrong
              while (date.getDate() == dom) {
                  date.setTime(date.getTime() - 1000);
              }
              // fix result
              date.setTime(date.getTime() + 1000);
          } else if (check.equals(this)) {
              // check for DST overlap (two midnights)
              Date earlier = new Date(date.getTime() - TimeZone.getDefault().getDSTSavings());
              if (earlier.getDate() == dom) {
                  date = earlier;
              }
          }
          return date;
      }