예제 #1
0
        /// <summary>
        /// Finds the offset info for a local date-time and transition.
        /// </summary>
        /// <param name="dt">  the date-time, not null </param>
        /// <param name="trans">  the transition, not null </param>
        /// <returns> the offset info, not null </returns>
        private Object FindOffsetInfo(LocalDateTime dt, ZoneOffsetTransition trans)
        {
            LocalDateTime localTransition = trans.DateTimeBefore;

            if (trans.Gap)
            {
                if (dt.IsBefore(localTransition))
                {
                    return(trans.OffsetBefore);
                }
                if (dt.IsBefore(trans.DateTimeAfter))
                {
                    return(trans);
                }
                else
                {
                    return(trans.OffsetAfter);
                }
            }
            else
            {
                if (dt.IsBefore(localTransition) == false)
                {
                    return(trans.OffsetAfter);
                }
                if (dt.IsBefore(trans.DateTimeAfter))
                {
                    return(trans.OffsetBefore);
                }
                else
                {
                    return(trans);
                }
            }
        }