Day-Night Sequence

Night time must be recorded in the pilot's logbook. EASA FCL.050 states that each logbook must include the operational conditions time, of which night time is one. However, this can sometimes be difficult because during a flight, there may be several periods when the flight changes from day to night and vice versa, so that there are several periods of night. But how exactly is night defined, and what are some of the possible factors that can affect night time?