How it works
The shading is worked out from the sun's position for the chosen moment. Where the sun is above the horizon it is day. Between the horizon and 18 degrees below it the sky is in twilight, and beyond that it is full night. Yellow dots are cities in daylight, blue dots are cities after dark.
Sunrise and sunset use the standard rule that counts the sun as risen when its top edge shows. Times are good to within a few minutes. Near the poles the sun may stay up or down all day, and the page says so. Everything is calculated in your browser.