This calculates Civil and Nautical twilight but not Astronomical twilight. For definitions, see here.
Astronomical twilight occurs after Nautical twilight by about the same amount of time as Nautical follows Civil. For example, twilight in Toronto for Earth Hour 2008 (Eastern Daylight Time) will be
- Sunset - 7:41pm
- Civil - 8:10pm
- Nautical - 8:44pm
- Astronomical - 9:20pm