public Answer GetAnswer(Question question) { var cityToken = question.GetToken<CityToken>(); var dateToken = question.GetToken<DateToken>(); int? year = null; if (dateToken != null) year = dateToken.Year; DaylightSavingInformation daylightSavingInfo; if (year.HasValue) { var firstDateInTheYear = new LocalDateTime(year.Value, 1, 1, 0, 0).InZone(DateTimeZoneProviders.Tzdb[cityToken.City.Timezone], Resolvers.LenientResolver); var firstZoneIntervalInTheYear = firstDateInTheYear.GetZoneInterval(); if (firstZoneIntervalInTheYear.IsoLocalEnd.Year > 10000) { daylightSavingInfo = DaylightSavingInformation.CreateWithNoDaylightSavings(); } else { var firstDateInTheNextZoneInterval = firstDateInTheYear.Plus(firstZoneIntervalInTheYear.Duration).Plus(Duration.FromMilliseconds(1)); daylightSavingInfo = GetDaylightSavingInfo(firstDateInTheNextZoneInterval); } } else { daylightSavingInfo = GetDaylightSavingInfo(cityToken.GetCurrentTime()); } var answerText = GetFormattedDaylightSavingInfo(daylightSavingInfo, cityToken.City); return new Answer(question, true, true, answerText); }