A free program for Android, by Emil Borconi-Szedressy.
If you are using the Android Auto head unit and the screen is always on, you will not be able to see anything on it and that can cause problems. There is a way to fix that. Night Toggler for Android Auto is a small app that will calculate the sunrise and sunset each day at 01:30 AM based on your current location then if it detects the phone being used in car mode and the time is after sunset will turn the night mode on. During day hours it set the phone to day mode, this can help drivers in countries where lights have to be always switched on, since that puts the phone in night mode.