Wingman has the most sophisticated algorithm to calculate night duration of a given flight.
The automatic calculation works for all modes of entry - Manual entry, Manual Roster Import, Auto Roster import It is calculated if Date, Airports, and Block timings are filled (timings in UTC).
The calculation is done using a sophisticated algorithm, that works for any pair of airports around the world. It works well for long haul flights also.
As per the Indian DGCA regulations, Night time is the between the period 30 minutes after sunset and 30 minutes before sunrise. The algorithm works as per the given rule.

The Night Duration Field can be edited too.
When the night duration is edited, the logged time as PIC/SIC etc in day and night changes automatically to reflect the new night time (This happens only if the date, airports and operating capacity is filled)
Refer the given GIF to see how the Night Duration field is calculated when the other fields are filled.