Class YearGuesser


  • public class YearGuesser
    extends Object
    • Constructor Detail

      • YearGuesser

        public YearGuesser()
    • Method Detail

      • guessYearForDate

        public static java.time.LocalDateTime guessYearForDate​(java.time.LocalDateTime dateWithoutYear,
                                                               java.time.LocalDateTime referenceDateTime)
        We try to guess the missing year for the given dateWithoutYear by assigning the year which brings the dateWithoutYear closest (smallest time gap) to the referenceDateTime. Assumptions: - dateTime and referenceDateTime have the same time zone. - dateTime.getYear() == 0 || dateTime.getYear() == 1970, otherwise we won't do anything
        Returns:
        the LocalDateTime with the best guessed year
      • guessYearForDate

        public static java.time.LocalDateTime guessYearForDate​(java.time.LocalDateTime dateWithoutYear)