private long winterOnOrBefore ( long utcDays ) { ZonalOffset offset = this . getOffset ( utcDays ) ; PlainDate date = PlainDate . of ( utcDays , EpochDays . UTC ) ; int year = ( ( ( date . getMonth ( ) <= 11 ) || ( date . getDayOfMonth ( ) <= 15 ) ) ? date . getYear ( ) - 1 : date . getYear ( ) ) ; Moment winter = AstronomicalSeason . WINTER_SOLSTICE . inYear ( year ) ; PlainDate d = winter . toZonalTimestamp ( offset ) . getCalendarDate ( ) ; if ( d . isAfter ( date ) ) { winter = AstronomicalSeason . WINTER_SOLSTICE . inYear ( year - 1 ) ; d = winter . toZonalTimestamp ( offset ) . getCalendarDate ( ) ; } return d . getDaysSinceEpochUTC ( ) ; }
search for winter solstice