Calculation and example
From 10 PM to midnight is 2 hours; midnight to 6 AM is another 6 hours. The total is 8 hours. Subtract a 30-minute unpaid break for 7 hours 30 minutes paid. On a daylight-saving transition, use actual dates, time zones and clock offsets rather than assuming all overnight shifts have this length.
Try it with your own values: Night Shift Calculator or Time Duration Calculator.