opening_hours knows a time called ‘dusk’, which seems to be the civil twilight, although I guess the sign refers to the time of sunset. In any case the evaluation tool accepts the following:
opening_hours = 08:00-20:00; dusk - 24:00 off
Please note that I ended the ‘off’ phase at a time that will always (apart from the polar circle) be after dusk.
If we use the actual ending time of 20:00, we might run into the case that dusk is after that time:
opening_hours = 08:00-20:00; dusk - 20:00 off
opening_hours evaluation tool
You might note that if dusk is after 8, the string “dusk - 20:00” is interpreted differently to the explicit “20:01 - 20:00”. The latter is interpreted as a time range wrapping around to the next day while the first one isn’t. Intuitively this makes a lot of sense, but is in fact not covered by the description given in the Wiki.
This is however not a bug, but documented behavior of the library (which seems to be the reference implementation of the tagging scheme). The documentation says:
A second thing to notice is that if [the time of sunrise] becomes greater than the end time […] than this time range will be ignored (e.g sunrise-08:00 becomes 08:03-08:00 for one day, it is ignored for this day).
GitHub - opening-hours/opening_hours.js: Library to parse and process the opening_hours tag from OpenStreetMap data