More context please
You mean the blue filter on display, which is often referred to as night mode?
I have programmed my bathroom light so that it shines fully during the day, at low brightness during the night, and at moderate brightness during 1 hour before and after sunrise and sunset. The time of sunrise and sunset is determined by a rule according to the day of the year.
If you mean automatic brightness correction, most computers have a camera, some have a more generic light sensor.
If you mean night mode, a computer knows what time it is and most know where they are, so they can look up local daylight hours.
If you mean something else, you’ll need to elaborate.
Why do people ask questions with too little context and then never follow up on people asking for clarification.