I like having the Windows light mode during the daytime and the dark mode during nighttime. My automation using Task Scheduler to achieve this was working well.
However, it could not really be made to follow the daily sunrise and sunset times (which keeps changing throughout the year). I felt that switching exactly at sunrise and sunset times would be a great mental indication while working. Thankfully, I discovered a fantastic tool called Auto Dark Mode X for Windows that solves this problem.
Source code: This is an open source project and the source code is at a Github project confusingly called by a different name Windows Auto Dark Mode.
Install: Find this app by name in the Windows Store here and install it.
Time: This tool can set the dark mode exactly for the sunset to sunrise times at my specific location. And as a great customization, it allows offsets from the sunset and sunrise times. This is great if you want to ease into dark mode a while after or before the scheduled times.
Explicitly switch mode: Right-click on the app’s taskbar icon to explicitly switch modes when that is required. For example, I like to use light mode if I am presenting my screen on a video call.